from sklearn.ensemble import RandomForestRegressor
import sklearn
from sklearn.datasets import load_boston
from sklearn.model_selection import cross_val_score
# 数据
boston = load_boston()
x = boston.data
y = boston.target
# 模型
regression = RandomForestRegressor(n_estimators=10, random_state=0)
print(sorted(sklearn.metrics.SCORERS.keys())) # 所有模型当中支持的评分系统
score = cross_val_score(regression, x, y, cv=10, scoring='neg_mean_squared_error')
print(score)