Hi
In the "Neural Networks in Trading" course While we want to scale RNN, in the course we first extract MIN and Max and after that use it for scaleing input data like below :
X1 = (data[['Open', 'High', 'Low', 'Close']]-min_)/(max_-min_)
X2 = scl.fit_transform(data[['Volume']].values.reshape(-1, 1))
but when I change it to :
X1 = scl.fit_transform(data[['Open', 'High', 'Low', 'Close']].values.reshape(-1, 1))
it works again . Is there any reason that we are recemended to use the first one code or both are correct ?
Hi Amir,
In the same line, you may already realise that scl is defined as MinMaxScaler(). So, MinMaxScaler() makes the exact calculation for X1 as it is in the code. That's why you find the same result. It is like calculating standard deviations manually vs using .std() function. We implement the min-max scaling method to X1 by calculating manually to show the scaling logic.
Hope this helps
Hi again ,
I check more, I find out the difference :
when we scale manually: range from (0,1) is based for all the data. means if you check max(df.High) you achieve to 1 but at the same time if check max(df.Clsoe) the result may be less than 1. the same for the other features and Min too.
That means your approach is correct.
Thanks anyway
Hi Amir,
Glad to see there is no confusion.
Regards