predict-coin/predict.py

31 lines
982 B
Python
Raw Normal View History

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
# x_train, y_train, tx_train, ty_train = load_pay_data(160)
# 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])
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])
# data = numpy.reshape([[15, 2359688 / 10000000, 255968 / 1000000, 10 / 10000]],(1, 4, 1))
# print( model.predict(data))