sklearn_svr.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Informed-Finance-Canary 作者: Darthone 项目源码 文件源码
def regressorOp(x, y):
    """
    This will optimize the parameters for the algo
    """
    regr_rbf = svm.SVR(kernel="rbf")
    C = [1000, 10, 1]
    gamma = [0.005, 0.004, 0.003, 0.002, 0.001]
    epsilon = [0.1, 0.01]
    parameters = {"C":C, "gamma":gamma, "epsilon":epsilon}

    gs = grid_search.GridSearchCV(regr_rbf, parameters, scoring="r2")   
    gs.fit(x, y)

    print "Best Estimator:\n", gs.best_estimator_
    print "Type: ", type(gs.best_estimator_)

    return gs.best_estimator_
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号