모델의 예측 결과와 레이블을 그래프로 출력합니다.

    코드 7-73 모델 예측 결과 출력

    train_predict = model(df_x_ss)
    predicted = train_predict.data.numpy()
    label_y = df_y_ms.data.numpy()
    
    predicted = ms.inverse_transform(predicted)
    label_y = ms.inverse_transform(label_y)
    plt.figure(figsize=(10,6))
    plt.axvline(x=200, c='r', linestyle='--')
    
    plt.plot(label_y, label='Actual Data')
    plt.plot(predicted, label='Predicted Data')
    plt.title('Time-Series Prediction')
    plt.legend()
    plt.show()
    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.