使用邏輯斯回歸在fit data一直出現錯誤"Found input variables with inconsistent numbers of samples: [512, 57]"?
2019/08/25 下午 05:48
機器學習共學討論版
周均亭
觀看數:435
回答數:1
收藏數:0
ml100-2-d38
ml100-2
請問我用以下方式練習logistic回歸,為何在fit data一直出現錯誤"Found input variables with inconsistent numbers of samples: [512, 57]"? 煩請幫忙解惑,謝謝!!!
回答列表
-
2019/08/26 上午 11:52Jimmy贊同數:0不贊同數:0留言數:0
Hi 均亭!
檢查一下你的 x_train.shape, y_train.shape 的第一個維度是否一樣,看起來是樣本的數量就對不起來囉!不過你為什麼要對 breast.data 做額外的處理?記得再送進模型前,檢查一下所有資料的 shape 是否合理喔!