2021-12-03 12:45:16 -05:00
|
|
|
import sys
|
2021-11-18 09:39:45 -08:00
|
|
|
import pytest
|
2022-04-28 14:06:29 -04:00
|
|
|
from utils import get_toy_data_seqclassification, get_automl_settings
|
2021-11-18 09:39:45 -08:00
|
|
|
|
|
|
|
|
2021-12-03 12:45:16 -05:00
|
|
|
@pytest.mark.skipif(sys.platform == "darwin", reason="do not run on mac os")
|
2021-11-16 14:06:20 -05:00
|
|
|
def test_cv():
|
|
|
|
from flaml import AutoML
|
2022-01-30 01:53:32 -05:00
|
|
|
import requests
|
2022-01-24 17:24:14 -05:00
|
|
|
|
2022-04-28 14:06:29 -04:00
|
|
|
X_train, y_train, X_val, y_val, X_test = get_toy_data_seqclassification()
|
2021-11-16 14:06:20 -05:00
|
|
|
automl = AutoML()
|
|
|
|
|
2022-04-28 14:06:29 -04:00
|
|
|
automl_settings = get_automl_settings()
|
|
|
|
automl_settings["n_splits"] = 3
|
2021-11-16 14:06:20 -05:00
|
|
|
|
2022-01-30 01:53:32 -05:00
|
|
|
try:
|
|
|
|
automl.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
|
|
|
except requests.exceptions.HTTPError:
|
|
|
|
return
|
2022-01-03 13:44:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
test_cv()
|