Auto ML 설치는 이전 게시물을 참고하길 바랍니다.
[ML] Colabolatory 에서 Auto ML 설치 (ERROR: pip's dependency resolver does not currently take into account all the packages
!pip install --upgrade setuptools ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This datascience 0.10.6 requres folium==0.2.1, but you ha..
chae52.tistory.com
공식 사이트이다.
auto-sklearn — AutoSklearn 0.13.0 documentation
auto-sklearn auto-sklearn is an automated machine learning toolkit and a drop-in replacement for a scikit-learn estimator: >>> import autosklearn.classification >>> cls = autosklearn.classification.AutoSklearnClassifier() >>> cls.fit(X_train, y_train) >>>
automl.github.io
설치 후에
from autosklearn.pipeline.components import regression
print(regression._regressors.keys())
odict_keys(['adaboost', 'ard_regression', 'decision_tree', 'extra_trees', 'gaussian_process', 'gradient_boosting', 'k_nearest_neighbors', 'liblinear_svr', 'libsvm_svr', 'mlp', 'random_forest', 'sgd'])
이 리스트 중에 자기가 필요한 모델을 골라서 따로 리스트를 만들어서 사용해도 됀다.
import autosklearn.regression
automl = autosklearn.regression.AutoSklearnRegressor(
time_left_for_this_task=120,
per_run_time_limit=30,
n_jobs=-1,
seed=1
)
automl.fit(x_train, y_train)
원하는 모델만 넣은 리스트가 있다면, include_estimor 로 넣으면 된다
automl.cv_results_['params'][np.argmax(automl.cv_results_['mean_test_score'])]
가장 좋은 결과를 보는 방법
pred=automl.predict(x_test)
submission['num'] = pred
submission.to_csv('automl.csv', index=False)
이런식으로 모델을 사용해서 예측해볼 수 있다.