Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x reg.coef uu返回相同值两次_Python 3.x_Machine Learning_Regression_Linear Regression_Data Science - Fatal编程技术网

Python 3.x reg.coef uu返回相同值两次

Python 3.x reg.coef uu返回相同值两次,python-3.x,machine-learning,regression,linear-regression,data-science,Python 3.x,Machine Learning,Regression,Linear Regression,Data Science,创建了一个线性回归模型,其中试图找到权重(系数)和偏差(y截距),从而运行以下代码:- reg.intercept_ reg.coef_ 输出 array([9.41523946, 9.41523946]) array([[-0.44871341, 0.20903483, 0.0142496 , 0.01288174, -0.14055166, -0.17990912, -0.06054988, -0.08992433, -0.1454692 , -0.10144383,

创建了一个线性回归模型,其中试图找到权重(系数)和偏差(y截距),从而运行以下代码:-

reg.intercept_
reg.coef_
输出

array([9.41523946, 9.41523946])
array([[-0.44871341,  0.20903483,  0.0142496 ,  0.01288174, -0.14055166,
        -0.17990912, -0.06054988, -0.08992433, -0.1454692 , -0.10144383,
        -0.20062984, -0.12988747, -0.16859669, -0.12149035, -0.03336798,
        -0.14690868,  0.32047333],
       [-0.44871341,  0.20903483,  0.0142496 ,  0.01288174, -0.14055166,
        -0.17990912, -0.06054988, -0.08992433, -0.1454692 , -0.10144383,
        -0.20062984, -0.12988747, -0.16859669, -0.12149035, -0.03336798,
        -0.14690868,  0.32047333]])

两次获取相同的值,而不是只获取一次,因此很难汇总权重

可能是您的输入为您提供了与输入相同的列。模型

你能提供你的数据集样本吗