autogen/test/ray/distribute_automl.py
Chi Wang 9e88f22167
fix a bug when using ray & update ray on aml (#455)
* fix a bug when using ray & update ray on aml
When using with_parameters(), the config argument must be the first argument in the trainable function.
* make training function runnable standalone
2022-02-11 20:14:10 -08:00

18 lines
434 B
Python

from ray_on_aml.core import Ray_On_AML
from flaml import AutoML
def _test_ray_classification():
from sklearn.datasets import make_classification
X, y = make_classification(1000, 10)
automl = AutoML()
automl.fit(X, y, time_budget=10, task="classification", n_concurrent_trials=2)
if __name__ == "__main__":
ray_on_aml = Ray_On_AML()
ray = ray_on_aml.getRay()
if ray:
_test_ray_classification()