小编elp*_*att的帖子

在scikit-learn LinearRegression中找到p值(显着性)

如何找到每个系数的p值(显着性)?

lm = sklearn.linear_model.LinearRegression()
lm.fit(x,y)
Run Code Online (Sandbox Code Playgroud)

python statistics regression numpy scikit-learn

130
推荐指数
9
解决办法
14万
查看次数

Numpy pcolormesh:TypeError:C的尺寸与X和/或Y不兼容

这段代码:

xedges = np.arange(self.min_spread - 0.5, self.max_spread + 1.5)
yedges = np.arange(self.min_span - 0.5, self.max_span + 1.5)
h, xe, ye = np.histogram2d(
    self.spread_values
    , self.span_values
    , [xedges, yedges]
)
fig = plt.figure(figsize=(7,3))
ax = fig.add_subplot(111)
x, y = np.meshgrid(xedges, yedges)
ax.pcolormesh(x, y, h)
Run Code Online (Sandbox Code Playgroud)

给出了这个错误:

TypeError: Dimensions of C (55, 31) are incompatible with X (56) and/or Y (32); see help(pcolormesh)
Run Code Online (Sandbox Code Playgroud)

如果有55x31箱,网格中的56x32箱边缘是否正确?

python numpy matplotlib

11
推荐指数
1
解决办法
8751
查看次数

5
推荐指数
1
解决办法
829
查看次数