Hi there and welcome to this new session in which we shall be building a linear regression model for
predicting the price of second hand cars.
In this section, we shall make use of different features, like the number of years the car has spent
on the road, number of kilometers covered, the car rating, the car's condition, the current state
of the economy, the top speed, the horsepower and the torque.
In order to predict the current price of that car at the end of the section, we shall build our model
such that we are able to obtain the model's predicted prices to be very close to the actual prices.
Like you could see in this plot, we have the predicted prices in orange and the actual prices in blue.
That said, in this section and in other machine learning projects we shall be working on, we will
make use of this machine learning development life cycle.
So we will start by defining the task.
Once the task is defined, we will try to understand and prepare the data.
Then once this is prepared, we will dive into building our model.
After building the model, we shall come up with a way of measuring the error.
Um, the model is going to make.
And then from here we'll dive into training our model and optimizing it.
Once the model is trained, we shall measure the model's performance based on the model's performance.
We shall then carry out corrective measures in order to better that model.
So now if we consider a simplified version of our task here we have only a single feature.
We have just this one feature right here.
And then we have our price in um, k dollars.
Then we will train our model with this known input output pairs, which we have right here.
Now our input um, in this case is just the horsepower.
But as we had seen already in the notebook, we actually have many more inputs.
So we have years kilometers ratings up to the torque.
So just for simplicity purposes, we've decided to select only one input feature.
So here we have our inputs.
That's it.
And then we have our output which is the current price.
So getting back to our board uh what we were saying is we are going to train our model on this input
output pairs.
That's the horsepower and its corresponding price horsepower and price.
And then once we're done with the training, we shall then be able to predict the price of a car when
given only the horsepower.
So when given a value of 80, we should be able to predict that the price is, um, let's say, for
example, x, um, k dollars.
Now we could represent this table right here by a plot like this one to the right where we would have
on the x axis the horsepower and on the y axis the price in K dollars.
And the idea now will be to come up with a mathematical function like, say, a straight line, um y
equal m x plus c, where the values of m and c are going to be chosen.
After we've trained the model on the different um input output pairs x y.
So after training on x, y, um, the model will learn to choose the best m and and C which suits this
data set such that if we have a new point, let's say if we have some new points around here, we shall
be able to, um, estimate the price based on the horsepower.
And so now, um, if we come up with this, um, function with the values of M and C gotten after training
the model, we get a new input like this one.
We shall make use of this to obtain the price of the car.