Skip to content

Instantly share code, notes, and snippets.

@martinthenext
Created October 20, 2011 00:40
Show Gist options
  • Save martinthenext/1300113 to your computer and use it in GitHub Desktop.
Save martinthenext/1300113 to your computer and use it in GitHub Desktop.
feature.m
X_norm = X;
mu = zeros(1, size(X, 2));
sigma = zeros(1, size(X, 2));
for featureIndex = 1:size(X, 2)
mu(1, featureIndex) = mean(X(:, featureIndex));
sigma(1, featureIndex) = std(X(:, featureIndex));
X_norm(:, featureIndex) = (X(:, featureIndex) .- mu(1, featureIndex)) ./ sigma(1, featureIndex)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment