Let's take a look at a concrete implementation of k it's cross-validation.
So we have the same data set credit scoring so credit they did not see yesterday we have the same features
so income age and loan we have the same target variable as default so 0 and 1.
And instead of splitting the data with the half of the train task split we are going to use this cross-validation.
So we just have to instantiate the logistic regression model and we just have to import the seeking
to learn import cross-validation and then we just have to call the function.
So cross-validation that cross surveiled predicate we have to define the model.
We have to define the features.
So income age and loan we have to define the target variable which is the default so 0 and 1 and we
are going to use 10 forwards you can use what ever you prefer if you do not specify this CV which defines
the number of forwards.
I guess the default is equal to 3.
So there are going to be three falls.
OK we calculate the predicate there and then we are able to measure the accuracy of our model.
So if we run this algorithm the accuracy of the model is ninety one person.
So basically it is approximately the same as we have seen for autistic regression but it is extremely
important to know the difference.
Here we have a training data set and that has the data that we train logistic regression model on the
training data set and then we make predictions on that task the data set.
Here we use K forward's cross-validation because we would like to make sure to use all the training
samples for training purposes and use all the samples for testing as well.
So this is why we have to use K for its validation who weighed ten fold.
And this is how we are able to implement it.
This is why sooky to learn and basically machine learning in Python is extremely powerful and very very
convenient.
OK so this is how we are dealing with credit scoring with the happen through Taoistic regression.
Thanks for watching.