Beispiel #1
0
def do_SVR(X, y, X_test, y_test):
    #params = [
    #    {'C': [1, 10, 100, 1000], 'kernel': ['linear']},
    #    {'C': [1, 10, 100, 1000], 'gamma': [0.001, 0.0001], 'kernel': ['rbf']},
    #]
    #svr = GridSearchCV(estimator=SVR(), param_grid=params, scoring='r2')
    svr = SVR(C=100)
    svr.fit(X, y)
    svr.test_score = svr.score(X_test, y_test)
    print('SVR score:', svr.test_score)
    return svr