I'm trying to save all models generated by autosklearn
, but I can only get the best model.
import sklearn.datasets
import sklearn.metrics
import autosklearn.classification
# Load data
X, y = sklearn.datasets.load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = \
sklearn.model_selection.train_test_split(X, y, random_state=1)
automl = autosklearn.classification.AutoSklearnClassifier(
time_left_for_this_task=120,
per_run_time_limit=30,
tmp_folder='/tmp/autosklearn_classification_example_tmp',
output_folder='/tmp/autosklearn_classification_example_out',
)
automl.fit(X_train, y_train, dataset_name='breast_cancer')
# Show all models
print(automl.show_models())
# Here it uses the best model
predictions = automl.predict(X_test)
print("Accuracy score:", sklearn.metrics.accuracy_score(y_test, predictions))
- Is
show_models()
printing models being used in the best ensamble model? - Is there any way to get other models?