#Why doesn't the reshape function , reshape the array globally

11 messages · Page 1 of 1 (latest)

tawny quiver
#

When I try to print the shape of the "y_pred" array out of the "concatenate" function the shape still remains unchanged.
So does that mean , whatever re-shaping happens inside the "concatenate" function , is only temporary ? PS: the shape of y_pred was (10,) previously as well

warped ridge
#

Numpy's reshape returns a new ndarray

#

It doesn't change it in place if I recall correctly

#

@tawny quiver

tawny quiver
#

so its just temporary then , just for the use of the function in context ?

warped ridge
#

Uhhhh yeah if you do it like that

tawny quiver
#

oh ok then , thank you so muchhh

#

also would you mind if i asked you another question

warped ridge
#

Just ask lol

tawny quiver
#

So , its basically about Feature Scaling using StandardScaler , on the x_train and x_test

#

why do we use the same StandardScaler object on both the test and train data(x_train and x_test) , wouldn't this lead to data leakage between the x_train and x_test data set ?

Using .fit_transform() method on x_train calculates the mean of x_train ,and by using the same object for x_test , the standardisation is done using the mean calculated for x_train