以下のコードを実行したら
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 5 is different from 1)
と出力されます。これは何に問題があると考えられるのでしょうか?
import numpy as np from sklearn.linear_model import LinearRegression lr = LinearRegression() x = np.array([ [ 3,5,7,9,10 ] ]) t = np.array([ [1,3,5,7,9] ]) lr.fit(x,t) x = np.array([ [4] ]) lr.predict(x)

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/12/08 06:20
2020/12/08 06:22
2020/12/08 06:44