Data Science Asked by mathematical inutition on February 25, 2021
I have got a X = mx3 array of input data and y = mx1 array of desired outcome data. Now I want to normalize the features accordingly: X[:, 1] holds size of a house, X[:, 2] holds number of rooms, X[:, 0] = 1 is just a constant term. I proceeded as follows:
sigma = np.std(X[:, 0])
mean = np.mean(X[:, 0])
X[:, 0] = (X[:, 0] - mean)/sigma
sigma = np.std(X[:, 1])
mean = np.mean(X[:, 1])
X[:, 1] = (X[:, 1] - mean)/sigma
X = np.c_[np.ones((p,1)), X]
I determined the mean value and the standard deviation of each column separately, does this procedure seem valid?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP