# Machine Learning for Regression

In machine learning, linear regression is a classification technique used on a dataset (training set) to enable the machine to automatically learn a decision-making model.

## How it Works

The algorithm labels (categorizes) instances using a continuous function.

Each row of the dataset is an example consisting of:

**Attributes (X)**. These are the predictive variables that describe a category.**Outcome (Y)**. This is the target variable that shows the machine the correct result if the instance belonged to label Z. It's the data that instructs the machine to make the right decision.

The machine learning algorithm needs to find a relationship between the X and Y variables through regression.

y=(x)

The end result is a straight line that minimizes the distance between the N examples in the training set that belong to the same category.

Once found, the **classification function** can be used to assess instances different from the training set.

If the coordinates (x,y) of an instance are close to the regression function f(x), the instance is classified under label Z.

And so on.