API Reference: Autofit

masterful.autofit

masterful.autofit(model, model_spec, labeled_data, data_spec, validation_data=None, unlabeled_data=None, synthetic_data=None, **kwargs)

Discover a policy and apply it to train a model.

Autofit is the primary interface to the Masterful AutoML Platform. It applies most of the functionality in the Advanced API towards training a more accurate model. But it also finds an approximately optimal policy to control the functionality, thereby eliminating manual searching. It also automatically takes advantage of available hardware capacity including multi-gpu to minimize training time.

Calls to autofit are generally multiple times longer than calls to tf.keras.Model.fit() due to the additional epochs required to find the optimal policy and then train to a lower error rate.

Parameters
  • model (keras.engine.training.Model) – The model to train.

  • model_spec (masterful.spec.ModelSpec) – Specification of the model.

  • labeled_data (tensorflow.python.data.ops.dataset_ops.DatasetV2) – The set of labeled data to use for training.

  • data_spec (masterful.spec.DataSpec) – Specification of the datasets.

  • validation_data (Optional[tensorflow.python.data.ops.dataset_ops.DatasetV2]) – [Optional] The dataset to use for internal evaluation. If None, Masterful will create its own validation dataset from the labeled data.

  • unlabeled_data (Optional[List[tensorflow.python.data.ops.dataset_ops.DatasetV2]]) – [Optional] List of unlabeled datasets to use for training.

  • synthetic_data (Optional[List[tensorflow.python.data.ops.dataset_ops.DatasetV2]]) – [Optional] List of synthetic datasets to use for training.

Returns

A tuple of [masterful.FitPolicy, masterful.core.FitReport] containing the results of analyzing and training the model on the datasets.

Return type

Tuple[masterful.policy.FitPolicy, masterful.core.FitReport]