根据https://scikit-learn.org/stable/modules/generated/sklearn.metrics.r2_score.html
1.传入参数时最好指定
y_true=..., y_pred=...,否则应注意顺序
2.注意形状
y_true:array-like of shape (n_samples,) or (n_samples, n_outputs)
因此需要将数据reshape,从而第一维=n_samples
根据https://scikit-learn.org/stable/modules/generated/sklearn.metrics.r2_score.html
1.传入参数时最好指定
y_true=..., y_pred=...,否则应注意顺序
2.注意形状
y_true:array-like of shape (n_samples,) or (n_samples, n_outputs)
因此需要将数据reshape,从而第一维=n_samples