def indexThreeMLP():
x = 10 ** 7
#?????
cur1 = conn.cursor()
cur1.execute('select * from szzs_black_swan limit 2,9999999999999999;')
result1 = cur1.fetchall()
fv = [] #??
for res in result1:
a = []
a.append(float(list(res)[3]))
a.append(float(list(res)[5])/x) #????????
fv.append(a)
cur2 = conn.cursor()
cur2.execute('select rise_fall_next from szzs_black_swan limit 2,9999999999999999;')
result2 = cur2.fetchall()
cla = [] #??
for res in result2:
cla.append(int(list(res)[0]))
cur3 = conn.cursor()
cur3.execute('select * from szzs_black_swan order by date desc;')
result3 = cur3.fetchmany(1)
test = [] #????
for res in result3:
test.append(float(list(res)[3]))
test.append(float(list(res)[5])/x)
fv = np.array(fv)
cla = np.array(cla)
test = np.array(test)
fv = np.array(fv)
cla = np.array(cla)
test = np.array(test)
mlp = MLPClassifier(solver='lbfgs', alpha=0.0001, hidden_layer_sizes=(1000, 200), random_state=1, batch_size='auto')
mlp.fit(fv, cla) # ????????
test = [test] # ???????????
prediction = mlp.predict(test)
return test, prediction
评论列表
文章目录