November 2017
Intermediate to advanced
374 pages
10h 19m
English
from sklearn.svm import SVRfrom sklearn.pipeline import Pipelinefrom sklearn.preprocessing import StandardScalerfrom sklearn.multiclass import OneVsRestClassifier svm_est = Pipeline([('scaler',StandardScaler()),('svc',OneVsRestClassifier(SVR()))])
Cs = [0.001, 0.01, 0.1, 1]gammas = [0.001, 0.01, 0.1] param_grid = dict(svc__estimator__gamma=gammas, svc__estimator__C=Cs)
from sklearn.model_selection import RandomizedSearchCVfrom sklearn.model_selection import StratifiedShuffleSplit rand_grid = RandomizedSearchCV(svm_est, param_distributions=param_grid, ...
Read now
Unlock full access