Last active
March 15, 2020 07:34
-
-
Save lylayang/07313539d5c91b648490a6a0b53ce194 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.preprocessing import MinMaxScaler | |
#create numpy.ndarray | |
df_arr= df1.values | |
df1.values = df_arr.astype('float32') | |
df_arr = np.reshape(df_arr, (-1, 1)) #LTSM requires more input features compared to RNN or DNN | |
scaler = MinMaxScaler(feature_range=(0, 1))#LTSM is senstive to the scale of features | |
df_arr = scaler.fit_transform(df_arr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment