Linear Regression with One Variable: Part-2

Supervised machine learning aims to learn a function that maps input features to output targets using a training dataset. This dataset consists of pairs of inputs x and corresponding true outputs y . The learning algorithm uses this data to produce a function f , which can then be used to make predictions on new, unseen inputs.

The Model

The function f is called the model, and its output \hat{y} = f(x) is the prediction or estimated value of the true target y . While y comes from the training data, \hat{y} is the value predicted by the model.

A key question in supervised learning is: How should we represent the function f ? What mathematical form should it take?

In linear regression, we assume that f is a straight line:

f_{w,b}(x) = wx + b

Where:

  • w is the weight (or slope),
  • b is the bias (or intercept),
  • x is the input feature,
  • f(x) is the predicted output \hat{y} .

The values of w and b are learned from the training data. Once the model is trained, it can take any new input x and output a corresponding prediction \hat{y} .

Visualizing the Model

In the figure below, we illustrate a simple linear regression model. The blue line represents the learned function f_{w,b}(x) = wx + b , and the red dots represent training data points, which may include some noise.

Starting with a linear model allows us to build intuition about how learning algorithms work. Once we understand linear regression, we can extend these ideas to more complex models such as polynomial regression, logistic regression, and neural networks.

Advertisements

Leave a Reply

Discover more from Cenk Yildiran

Subscribe now to keep reading and get access to the full archive.

Continue reading