【发布时间】:2018-03-29 12:59:18
【问题描述】:
我目前正在使用 scipy 绘制数据矩阵 X 中一组特征变量的正态概率图。但是,我正在使用的模块没有返回我的 r^2 值。这是我的简单代码:
Data_Matrix=pd.read_csv('My csv')
My_datum=My_Data.as_matrix()
#loop through all feature variables
for i in range(My_datum.shape[1]):
#just a simple print line for the column index and its shapiro test
results
print(i)
print(a)
#plot
pplot=stats.probplot(My_datum[:,i],dist='norm',fit=True, plot=plt )
a=sp.stats.shapiro(My_datum[:,i])
我尝试在一些更简单的 numpy 数组上使用同一行,但无济于事。我正在 spyder 3 上使用 Ipython 控制台。提前致谢!
【问题讨论】:
-
什么是
r^2,为什么它必须返回那个值? -
R^2 = 拟合优度
-
r^2 是决定系数,是 Stuart Buckingham 所说的线性预测器的“强度”!如果我能提供更多细节,请告诉我!
标签: python-3.x numpy scipy spyder