Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature scaling missing #5

Open
davidglavas opened this issue Jan 28, 2018 · 1 comment
Open

Feature scaling missing #5

davidglavas opened this issue Jan 28, 2018 · 1 comment

Comments

@davidglavas
Copy link

davidglavas commented Jan 28, 2018

price = [1 1650 3] * theta;

The size and number of bedrooms should be scaled with the previously computed mean mu and standard deviation sigma.

From Andrew Ng's exercise sheet:

Implementation Note: When normalizing the features, it is important
to store the values used for normalization - the mean value and the stan-
dard deviation used for the computations. After learning the parameters
from the model, we often want to predict the prices of houses we have not
seen before. Given a new x value (living room area and number of bed-
rooms), we must rst normalize x using the mean and standard deviation
that we had previously computed from the training set.

@davidglavas
Copy link
Author

Suggestion:

price = 1650;
bedrooms = 3;
example = [1, (price-mu(1))/sigma(1), (bedrooms-mu(2))/sigma(2)];	% feature scaling
price = example*theta; % (You should change this) -> changed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant