바뀜

둘러보기로 가기 검색하러 가기
619 바이트 추가됨 ,  2021년 12월 24일 (금) 14:23
새 문서: == 개요 == 모델을 만들었으면, 어떻게 사용해야 할까?? <syntaxhighlight lang="python"> pred_input = next(test_data) # 인풋 데이터 pred = model.predic...
== 개요 ==
모델을 만들었으면, 어떻게 사용해야 할까??

<syntaxhighlight lang="python">
pred_input = next(test_data) # 인풋 데이터
pred = model.predict(pred_input[0]) # 예측 해본다.
real = pred_input[1] # 실제 정답.

pred = pred.reshape(150, 1) # 1차원으로 줄인다.
real = real.reshape(150, 1)

# 시각화 과정.
import matplotlib.pyplot as plt
fig = plt.figure(facecolor='white', figsize=(20, 10))
ax = fig.add_subplot(111)
ax.plot(real, label='True')
ax.plot(pred, label='Prediction')
ax.legend()
plt.show()
</syntaxhighlight>
[[분류:Keras]]

둘러보기 메뉴