mirror of
https://github.com/microsoft/FLAML.git
synced 2026-02-08 17:59:17 +08:00
* Update gitignore * Bump version to 2.4.0 * Update readme * Pre-download california housing data * Use pre-downloaded california housing data * Pin lightning<=2.5.6 * Fix typo in find and replace * Fix estimators has no attribute __sklearn_tags__ * Pin torch to 2.2.2 in tests * Fix conflict * Update pytorch-forecasting * Update pytorch-forecasting * Update pytorch-forecasting * Use numpy<2 for testing * Update scikit-learn * Run Build and UT every other day * Pin pip<24.1 * Pin pip<24.1 in pipeline * Loosen pip, install pytorch_forecasting only in py311 * Add support to new versions of nlp dependecies * Fix formats * Remove redefinition * Update mlflow versions * Fix mlflow version syntax * Update gitignore * Clean up cache to free space * Remove clean up action cache * Fix blendsearch * Update test workflow * Update setup.py * Fix catboost version * Update workflow * Prepare for python 3.14 * Support no catboost * Fix tests * Fix python_requires * Update test workflow * Fix vw tests * Remove python 3.9 * Fix nlp tests * Fix prophet * Print pip freeze for better debugging * Fix Optuna search does not support parameters of type Float with samplers of type Quantized * Save dependencies for later inspection * Fix coverage.xml not exists * Fix github action permission * Handle python 3.13 * Address openml is not installed * Check dependencies before run tests * Update dependencies * Fix syntax error * Use bash * Update dependencies * Fix git error * Loose mlflow constraints * Add rerun, use mlflow-skinny * Fix git error * Remove ray tests * Update xgboost versions * Fix automl pickle error * Don't test python 3.10 on macos as it's stuck * Rebase before push * Reduce number of branches
29 lines
795 B
Python
29 lines
795 B
Python
from sklearn.datasets import fetch_california_housing
|
|
|
|
from flaml import AutoML
|
|
|
|
# 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, data_home="test")
|
|
# 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)
|