mirror of
https://github.com/microsoft/FLAML.git
synced 2026-02-09 10:19:18 +08:00
* lint * bump ver * bump ver * fixed circular import --------- Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
14 lines
424 B
Python
14 lines
424 B
Python
from flaml.automl.data import load_openml_dataset
|
|
from flaml.automl.ml import sklearn_metric_loss_score
|
|
from flaml.default import XGBClassifier
|
|
|
|
X_train, X_test, y_train, y_test = load_openml_dataset(dataset_id=1169, data_dir="./")
|
|
xgb = XGBClassifier()
|
|
xgb.fit(X_train, y_train)
|
|
y_pred = xgb.predict(X_test)
|
|
print(
|
|
"flamlized xgb accuracy =",
|
|
1 - sklearn_metric_loss_score("accuracy", y_pred, y_test),
|
|
)
|
|
print(xgb)
|