So let's go to a new tab.
All right.
And then let's just type because I'm going to show you a trick actually.
Let's just type scikit learn scikit learn just scikit learn.
And then let's go to the first link and you will be
on the welcoming page of scikit learn which by the way looks super nice.
And then I'm going to show you something very interesting.
I'm going to show you the whole API of the scikit learn library.
You know, the API is the whole library containing all the modules
and inside all the functions and the classes.
All right.
So these are all the modules starting from the base one.
And the one I actually want to show you right now is the metrics module.
The metrics module which we'll find by scrolling down a bit
scrolling down a bit more until we find them, should find it very quickly.
There we go. Scikit learn metrics.
All right.
So as you might guess, this is the module that contains
all the metrics of machine learning models,
which therefore includes classification models which we'll see in part three
and what we are interested in now, the regression models
and in the regression models here are the metrics.
Let's have a look. Well you have many of them.
You have the explained variance score the max error, the mean absolute error.
The mean squared error. The mean squared look error.
You know you have many of them.
But the one we will use now after it is intuition.
Lecture is of course the r squared.
The r squared score which is of course the coefficient
of determination regression score function okay.
So there is not the adjusted r squared.
But that's totally fine. The r squared is fine.
You will perfectly be able to evaluate the performance and mostly compare
the performances of your regression models to select the best one.
So let's click this metric here and we will find,
well the name of the function which we will use.
There you go to measure the r squared coefficient
for each of our different regression models here.
And that's exactly what you have
at the end is less L which I didn't want to reveal until now.
That's indeed R2 score function, which allows us to evaluate
the model performance of your regression model
with the r squared coefficient of determination.
All right.
So you have the same in each regression models.
You know R2 score right R2 score here as well.
That's exactly the same code actually
because you know I made this code templates 100% generic.
So there you go.
You have the R2 score function measuring the coefficient
of determination meaning the r squared.
And you know, it's
still in the assumption that I had no idea on how to implement the r squared score.
Well here. What did I do?
I actually went to the examples and there you go.
I just took this line of code, which clearly means that we're
measuring the r squared score between, you know, the vector of real results.
And your vector of predictions.
So I just took this.
And then of course I took this before in order to import, of course the R2 score
function from the metrics module from scikit learn and so that's why,
you know in each implementation that's exactly what you see here.
I import first R2 score function from the metrics module by scikit learn.
And then I call this R2 score function on the white test
which contains the real results.
You know, the real values of the dependent variable in the test set,
and y pred contain the predictions of the same observations in the test set.
All right.
So that's only what you would have to do in order to figure out
how to, you know, evaluate the model performance of regression models.
Right.
So that's why I really want you to have the reflex to look
at the documentation and quickly find the information you need.
All right.
And now, my friends, time for the exciting step.
I'm talking of course about the demo.
So let's just take a quick little break and we'll start directly
in the next tutorial.