predict-coin/predict_pay.py
2021-04-02 18:40:15 +08:00

22 lines
568 B
Python

import numpy
from keras.models import load_model
from data import load_pay_data, load_gift_data
import matplotlib
import matplotlib.pyplot as plt
x_train, y_train, tx_train, ty_train, _ = load_pay_data(320)
model = load_model("./predict_pay")
p_data = model.predict(tx_train)
for i in range(len(p_data)):
comp = (p_data[i][0] - ty_train[i]) / ty_train[i]
print(comp, p_data[i][0], ty_train[i])
if abs(comp) >= 1:
print("测结果:", p_data[i][0], "测:", tx_train[i], "真实:", ty_train[i])
plt.plot(ty_train)
plt.plot(p_data)
plt.show()