1. # coding=utf-8
    2. from data_load import load_data
    3. import numpy as np
    4. from sklearn.svm import SVR
    5. from sklearn.model_selection import train_test_split # 这里是引用了交叉验证
    6. X,y = load_data()
    7. # 训练数据
    8. X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    9. clf = SVR(kernel='rbf',C=1e3, epsilon=0.2,gamma=0.01)
    10. # model = clf.fit(X_train, y_train)
    11. for i in range(2):
    12. clf.fit(X_train, y_train)
    13. # 预测
    14. y_pred = clf.predict(X_test)