我正在尝试将线性回归模型的预测绘制为 3D 中的最佳拟合线,x 和 y 是特征,z_pred 是预测。我尝试了多次重塑。我不知道这个错误说明了什么。AttributeError:“Line3D”对象没有属性“_verts3d”
这是我正在尝试的代码
ax1.plot(df['x'], df['y'], z_pred, "r-", linewidth = 2, label = 'Predictions')
ax1.scatter3D(df['x'], df['y'], df['z'], c=df['z'], cmap = 'jet');
ax1.set_xlabel('x', color = 'red')
ax1.set_ylabel('y' , color = 'red')
ax1.set_zlabel('z' , color = 'red')
ax1.view_init(0, 90) ```