差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
pytorch:regression [2022/06/02 13:55] watalupytorch:regression [2022/06/02 13:56] (現在) watalu
行 120: 行 120:
 ax.plot(loss_test_history, color="red") ax.plot(loss_test_history, color="red")
 plt.show() plt.show()
 +fig, ax = plt.subplots()
 +ax.plot(loss_train_history, color="blue")
 +ax.plot(loss_test_history, color="red")
 plt.ylim(0, 8000) plt.ylim(0, 8000)
 plt.show() plt.show()
行 131: 行 134:
 pred=result.data[:,0].numpy() pred=result.data[:,0].numpy()
 print(len(pred),len(y_train)) print(len(pred),len(y_train))
-r2_score(pred,y_train)+print(r2_score(pred,y_train))
  
 X = Variable(torch.FloatTensor(X_test))  X = Variable(torch.FloatTensor(X_test)) 
行 137: 行 140:
 pred=result.data[:,0].numpy() pred=result.data[:,0].numpy()
 print(len(pred),len(y_test)) print(len(pred),len(y_test))
-r2_score(pred,y_test)+print(r2_score(pred,y_test))
 </code> </code>