machine-learning-book icon indicating copy to clipboard operation
machine-learning-book copied to clipboard

Ch12, when standard the train data

Open JPL-JUNO opened this issue 2 years ago • 1 comments

X_train_norm = (X_train - np.mean(X_train)) / np.std(X_train) use the mean and std of whole dataset. I think the correct way is to use mean and std of each column, X_train_norm = (X_train - np.mean(X_train, axis=0)) / np.std(X_train, axis=0) https://github.com/rasbt/machine-learning-book/blob/92e2320709071b4dcc82a99552aec145536cfbcd/ch12/ch12_part2.py#L239 (forgive my poor English)

JPL-JUNO avatar Jul 06 '23 06:07 JPL-JUNO

You are totally right, thanks for the note! (cc @haydenliu )

rasbt avatar Jul 06 '23 17:07 rasbt