Skip to content

Commit

Permalink
Don't normalize just one feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
trekhleb committed Dec 12, 2018
1 parent f9e7c43 commit d804b27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion homemade/utils/features/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def normalize(features):

# Subtract mean values from each feature (column) of every example (row)
# to make all features be spread around zero.
features_normalized -= features_mean
if features.shape[0] > 1:
features_normalized -= features_mean

# Normalize each feature values so that all features are close to [-1:1] boundaries.
# Also prevent division by zero error.
Expand Down

0 comments on commit d804b27

Please sign in to comment.