2021-03-19 09:14:35 +00:00
|
|
|
import numpy
|
|
|
|
from keras.models import load_model
|
|
|
|
from data import load_pay_data, load_gift_data
|
|
|
|
|
2021-03-23 10:12:32 +00:00
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
|
2021-03-25 09:36:09 +00:00
|
|
|
# x_train, y_train, tx_train, ty_train, _ = load_pay_data(160)
|
2021-03-19 09:14:35 +00:00
|
|
|
# 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])
|
|
|
|
|
|
|
|
|
2021-03-25 09:36:09 +00:00
|
|
|
x_train, y_train, tx_train, ty_train, _ = load_gift_data(160)
|
2021-03-19 09:14:35 +00:00
|
|
|
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])
|
|
|
|
|
2021-03-23 10:12:32 +00:00
|
|
|
|
|
|
|
plt.plot(ty_train)
|
|
|
|
plt.plot(p_data)
|
|
|
|
plt.show()
|
2021-03-19 09:14:35 +00:00
|
|
|
# data = numpy.reshape([[15, 2359688 / 10000000, 255968 / 1000000, 10 / 10000]],(1, 4, 1))
|
|
|
|
# print( model.predict(data))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|