# Mean Normalization

In addition to scaling the features, some may also consider Mean Normalization.

In this, we replace $$x\_i$$ by $$x\_i-μ\_i$$ so as to make the features have approximately 0 mean.

(**Note**: This is not applied for $$x\_0$$ which has a fixed value 1).

In general, we can use the following formula to scale the features using mean normalization:

$$x\_i = (x\_i-μ\_i)/S\_i$$

where $$x\_i$$ is the $$i^{th}$$ feature, $$μ\_i$$ is its mean and $$S\_i$$ is its range (i.e. max-min).

If this leads to $$x\_i$$ being in the range \[-0.5, 0.5] approximately, the gradient descent will work quickly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vikram-bajaj.gitbook.io/machine-learning-stanford-coursera/supervised-learning/linear-regression/multivariate-linear-regression/mean-normalization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
