mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-31 21:02:33 +00:00

A new documentation website. And: * add actions for doc * update docstr * installation instructions for doc dev * unify README and Getting Started * rename notebook * doc about best_model_for_estimator #340 * docstr for keep_search_state #340 * DNN Co-authored-by: Qingyun Wu <qingyun.wu@psu.edu> Co-authored-by: Z.sk <shaokunzhang@psu.edu>
28 lines
776 B
Python
28 lines
776 B
Python
from flaml import AutoML
|
|
from sklearn.datasets import fetch_california_housing
|
|
|
|
# Initialize an AutoML instance
|
|
automl = AutoML()
|
|
# Specify automl goal and constraint
|
|
automl_settings = {
|
|
"time_budget": 1, # in seconds
|
|
"metric": "r2",
|
|
"task": "regression",
|
|
"log_file_name": "test/california.log",
|
|
}
|
|
X_train, y_train = fetch_california_housing(return_X_y=True)
|
|
# Train with labeled input data
|
|
automl.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
|
print(automl.model)
|
|
print(automl.model.estimator)
|
|
|
|
print(automl.best_estimator)
|
|
print(automl.best_config)
|
|
print(automl.best_config_per_estimator)
|
|
|
|
print(automl.best_config_train_time)
|
|
print(automl.best_iteration)
|
|
print(automl.best_loss)
|
|
print(automl.time_to_find_best_model)
|
|
print(automl.config_history)
|