其他分享
首页 > 其他分享> > sklearn练习1 回归

sklearn练习1 回归

作者:互联网

 

from sklearn.svm import SVR
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
import numpy as np
n_samples, n_features = 10, 5
rng = np.random.RandomState(0)
y = rng.randn(n_samples)
X = rng.randn(n_samples, n_features)
regr = make_pipeline(StandardScaler(), SVR(C=1.0, epsilon=0.2))
regr.fit(X, y)

#输出
Pipeline(steps=[('standardscaler', StandardScaler()),
                ('svr', SVR(epsilon=0.2))])


#svr_rbf = SVR(kernel='rbf', C=100, gamma=0.1, epsilon=.1)
#svr_rbf.fit(train_x, train_y)

  

标签:epsilon,回归,练习,samples,import,SVR,StandardScaler,sklearn
来源: https://www.cnblogs.com/Li-JT/p/16335377.html