nicodjimenez / lstm

Minimal, clean example of lstm neural network training in python, for learning purposes.
1.72k stars 654 forks source link

new dataset #29

Open KaaiLee opened 6 years ago

KaaiLee commented 6 years ago

if i want run the code in new dataset,and the data range not in [-1,1],what should i do?

fmscole commented 6 years ago

i want the anwser too. i do this like:

y_list = [1,-0.8333333333, 0.33333, 0.166666667, -0.8] ymax=np.max(np.abs(y_list))*1.2 y_list=y_list/ymax

other example:

from sklearn.preprocessing import MinMaxScaler scaler = MinMaxScaler() scaler.fit(datos) datos = scaler.transform(datos) .............. real_tot_scl = scaler.inverse_transform(real_tot) pred_tot_scl = scaler.inverse_transform(pred_tot)