Skip to content

supervised

Supervised

The base class for all supervised task.

Attributes
  • verbose: A boolean value indicating the verbosity mode.

init

Initialize the instance.

Args
  • verbose: A boolean of whether the search process will be printed to stdout.

fit

Find the best neural architecture and train it. Based on the given dataset, the function will find the best neural architecture for it. The dataset is in numpy.ndarray format. So they training data should be passed through x_train, y_train.

Args
  • x: A numpy.ndarray instance containing the training data or the training data combined with the validation data.

  • y: A numpy.ndarray instance containing the label of the training data. or the label of the training data combined with the validation label.

  • time_limit: The time limit for the search in seconds.

final_fit

Final training after found the best architecture.

Args
  • x_train: A numpy.ndarray of training data.

  • y_train: A numpy.ndarray of training targets.

  • x_test: A numpy.ndarray of testing data.

  • y_test: A numpy.ndarray of testing targets.

  • trainer_args: A dictionary containing the parameters of the ModelTrainer constructor.

  • retrain: A boolean of whether reinitialize the weights of the model.

predict

Return predict results for the testing data.

Args
  • x_test: An instance of numpy.ndarray containing the testing data.
Returns

evaluate

Return the accuracy score between predict value and y_test.

DeepSupervised

init

Initialize the instance. The classifier will be loaded from the files in 'path' if parameter 'resume' is True. Otherwise it would create a new one.

Args
  • verbose: A boolean of whether the search process will be printed to stdout.

  • path: A string. The path to a directory, where the intermediate results are saved.

  • resume: A boolean. If True, the classifier will continue to previous work saved in path. Otherwise, the classifier will start a new search.

  • searcher_args: A dictionary containing the parameters for the searcher's init function.

  • search_type: A constant denoting the type of hyperparameter search algorithm that must be used.

final_fit

Final training after found the best architecture.

Args
  • x_train: A numpy.ndarray of training data.

  • y_train: A numpy.ndarray of training targets.

  • x_test: A numpy.ndarray of testing data.

  • y_test: A numpy.ndarray of testing targets.

  • trainer_args: A dictionary containing the parameters of the ModelTrainer constructor.

  • retrain: A boolean of whether reinitialize the weights of the model.

export_keras_model

Exports the best Keras model to the given filename.

predict

Return predict results for the testing data.

Args
  • x_test: An instance of numpy.ndarray containing the testing data.
Returns

evaluate

Return the accuracy score between predict value and y_test.

PortableClass

fit

further training of the model (graph).

predict

Return predict results for the testing data.

Args
  • x_test: An instance of numpy.ndarray containing the testing data.
Returns

evaluate

Return the accuracy score between predict value and y_test.

PortableDeepSupervised

init

Initialize the instance.

Args
  • graph: The graph form of the learned model.

  • y_encoder: The encoder of the label. See example as OneHotEncoder

  • data_transformer: A transformer class to process the data. See example as ImageDataTransformer.

  • verbose: A boolean of whether the search process will be printed to stdout.

  • path: A string. The path to a directory, where the intermediate results are saved.

fit

further training of the model (graph).

Args
  • x_train: A numpy.ndarray of training data.

  • y_train: A numpy.ndarray of training targets.

  • x_test: A numpy.ndarray of testing data.

  • y_test: A numpy.ndarray of testing targets.

  • trainer_args: A dictionary containing the parameters of the ModelTrainer constructor.

  • retrain: A boolean of whether reinitialize the weights of the model.

predict

Return predict results for the testing data.

Args
  • x_test: An instance of numpy.ndarray containing the testing data.
Returns

evaluate

Return the accuracy score between predict value and y_test.