from sklearn.svm import SVC
from sklearn.model_selection import GridSearchCV
param_C = np.logspace(-6, 3, 5)
parameters = [{‘kernel’: [‘rbf’], ‘C’: param_C},
{‘kernel’: [‘poly’], ‘C’: param_C, ‘degree’: [2,3,4]}]
clf_svc = SVC(random_state = 7)
clf_GSCV = GridSearchCV(estimator = clf_svc, param_grid = parameters, cv = 5, n_jobs = -1)
clf_GSCV.fit(X_train.values, y_train.values.flatten())
Been trying this code of using GridSearch on SVM to find optimal values for hyperparameters like C and explore score functions. However keep getting stalled on jupyter notebook on clf_GSCV.fit(X_train.values, y_train.values.flatten())
It is freezing. Any suggestions?
This is the dataset being used Smartphone-Based Recognition of Human Activities and Postural Transitions - UCI Machine Learning Repository