Created
September 19, 2020 12:50
-
-
Save PhilipPurwoko/f213514794250e618e6a62245da92059 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Menggunakan GridSearchCV untuk menemukan model dengan parameter terbaik | |
from sklearn.model_selection import GridSearchCV | |
# SVC Model Hyperparameter | |
param_grid = {'C':[0.01,0.1,1,10,100], | |
'gamma':[100,10,1,0,1,0.01]} | |
# Membuat model terbaik dari semua kemungkinan kombinasi param_grid | |
best_model = GridSearchCV(SVC(),param_grid,cv=5,refit=True) | |
# Melatih model terbaik | |
best_model.fit(x_train,y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment