小编Ruc*_*cha的帖子

ValueError:找到输入样本数量不一致的输入变量:[2750,1095]

如果有人可以帮助我了解此错误以及如何解决该错误,那将非常有帮助。我无法更改数据。

 X = train[['id', 'listing_type', 'floor', 'latitude', 'longitude', 
             'beds', 'baths','total_rooms','square_feet','group','grades']]
    Y = test['price']
    n = pd.get_dummies(train.group)  
Run Code Online (Sandbox Code Playgroud)

以下是训练数据的样子:

id  listing_type    floor   latitude    longitude   beds    baths   total_rooms square_feet grades  high_price_high_freq    high_price_low_freq low_price
265183  10  4   40.756224   -73.962506  1   1   3   790 2   1   0   0   0
270356  10  7   40.778010   -73.962547  5   5   9   4825    2   1   0   0
176718  10  25  40.764955   -73.963483  2   2   4   1645    2   1   0   0
234589  10  5   40.741448   -73.994216  3   3   5   2989    2 …
Run Code Online (Sandbox Code Playgroud)

machine-learning linear-regression python-3.x scikit-learn

4
推荐指数
1
解决办法
6419
查看次数