我是机器学习的新手,我正在使用 MLPRegressor。我用
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
然后我制作并拟合模型,对测试集使用 10 倍验证。
nn = MLPRegressor(hidden_layer_sizes=(100, 100), activation='relu',
solver='lbfgs', max_iter=500)
nn.fit(X_train, y_train)
TrainScore = nn.score(X_train, y_train)
kfold = KFold(n_splits=10, shuffle=True, random_state=0)
print("Cross-validation scores:\t{} ".format(cross_val_score(nn, X_test, y_test, cv=kfold)))
av_corss_val_score = np.mean(cross_val_score(nn, X_test, y_test, cv=kfold))
print("The average cross validation score is: {}".format(av_corss_val_score))
问题是我收到的测试分数非常负(-4256)。有什么可能是错的?