# Refactor to fix featureNormalize - DOES NOT WORK
def featureNormalize(feature_dict):
feature_vector = dict_to_vector(feature_dict)
# returns a normalized version of X where the mean value of
# each feature is 0 and the standard deviation is 1
X_norm = feature_vector
num_features = feature_vector.length()
mu = np.zeros(1, num_features)
sigma = np.zeros(1, num_features)
for i in num_features:
mu[i] = np.mean(X(:, i))
X_norm[:, i] = X(:, i) - mu(i)
sigma[i] = np.std(X(:, i))
X_norm[:, i] = X_norm(:, i) / sigma(i)
normalization_dict = {}
normalization_dict['X_norm'] = X_norm
normalization_dict['mu'] = mu
normalization_dict['sigma'] = sigma
return normalization_dict