machine-learning-book
machine-learning-book copied to clipboard
Ch12, when standard the train data
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)
You are totally right, thanks for the note! (cc @haydenliu )