This commit is contained in:
Anonymous-submission-repo
2022-10-12 04:31:51 +00:00
parent ecca161848
commit 2d18c49cdd
12 changed files with 290 additions and 100 deletions

View File

@@ -2,7 +2,7 @@ from flaml import AutoML
from flaml.data import load_openml_dataset
def _test_lexiflow():
def test_lexiflow():
X_train, X_test, y_train, y_test = load_openml_dataset(
dataset_id=179, data_dir="test/data"
@@ -13,28 +13,18 @@ def _test_lexiflow():
lexico_objectives["tolerances"] = {"val_loss": 0.01, "pred_time": 0.0}
lexico_objectives["targets"] = {"val_loss": 0.0, "pred_time": 0.0}
lexico_objectives["modes"] = ["min", "min"]
automl = AutoML()
settings = {
"time_budget": 100,
"lexico_objectives": lexico_objectives,
"estimator_list": ["xgboost"],
"use_ray": True,
"use_ray": False,
"task": "classification",
"max_iter": 10000000,
"train_time_limit": 60,
"verbose": 0,
"eval_method": "holdout",
"max_iter": -1,
"mem_thres": 128 * (1024**3),
"seed": 1,
}
automl.fit(X_train=X_train, y_train=y_train, X_val=X_test, y_val=y_test, **settings)
print(automl.predict(X_train))
print(automl.model)
print(automl.config_history)
print(automl.best_iteration)
print(automl.best_estimator)
if __name__ == "__main__":
_test_lexiflow()
test_lexiflow()

View File

@@ -12,7 +12,7 @@ N_TRAIN_EXAMPLES = BATCHSIZE * 30
N_VALID_EXAMPLES = BATCHSIZE * 10
def _test_lexiflow():
def test_lexiflow():
train_dataset = torchvision.datasets.FashionMNIST(
"test/data",
train=True,
@@ -109,18 +109,16 @@ def _test_lexiflow():
"n_epoch": 1,
}
analysis = tune.run(
tune.run(
evaluate_function,
num_samples=100000000,
num_samples=-1,
time_budget_s=100,
config=search_space,
use_ray=False,
lexico_objectives=lexico_objectives,
low_cost_partial_config=low_cost_partial_config,
)
result = analysis.best_result
print(result)
if __name__ == "__main__":
_test_lexiflow()
test_lexiflow()