我目前正在使用scipy绘制数据矩阵X中的一组特征变量的正常可靠性图。但是,我使用的模块没有返回我的r^2值。这是我的简单代码:Scipy stats.probplot不会返回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',为什么它必须返回该值? – eyllanesc
R^2 =拟合优度 –
r^2是决定系数,是Stuart Buckingham所说的线性预测的“强度”。让我知道,如果我可以提供更多的细节! – user7351362