See also

We can also use grid search with AdaBoost:

#grid search using svm
Adaboost_with_svc = AdaBoostClassifier(n_estimators=100, base_estimator=SVC(probability=True, kernel='linear'), learning_rate=1, algorithm= 'SAMME')

Ada_Grid = {'n_estimators': [10,30,40,100],
'learning_rate': [0.1, 0.2, 0.3]}

estimator = Adaboost_with_svc
Adaboost_with_grid_search = GridSearchCV(estimator,Ada_Grid).fit(X_train, Y_train)
print(Adaboost_with_grid_search.best_params_)
print(Adaboost_with_grid_search.best_score_)

In the preceding code, we performed a grid search with the n_estimators set to 10, 30, 40, and 100, and learning_rate set to 0.1, 0.2, and 0.3.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset