predict-coin/predict_gift.py

25 lines
561 B
Python
Raw Permalink Normal View History

2021-04-02 09:22:46 +00:00
import numpy
from keras.models import load_model
from data import load_pay_data, load_gift_data
import matplotlib.pyplot as plt
x_train, y_train, tx_train, ty_train, _ = load_gift_data(160)
model = load_model("./predict_gift")
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) >= 0.1:
print("测结果:", p_data[i][0], "测:", tx_train[i], "真实:", ty_train[i])
plt.plot(ty_train)
plt.plot(p_data)
plt.show()