Open JPL-JUNO opened 1 year ago
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)
X_train_norm = (X_train - np.mean(X_train)) / np.std(X_train)
X_train_norm = (X_train - np.mean(X_train, axis=0)) / np.std(X_train, axis=0)
You are totally right, thanks for the note! (cc @haydenliu )
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)