dataset = pandas.read_csv("diabetes.csv")
D = dataset.values
X = D[:, :-1]
y = D[:, -1]
Now, we are initializing the Ridge classifier using the RidgeClassifier class.
model = RidgeClassifier()
We are using k-fold cross-validation with 10 splits. We are also shuffling the dataset before splitting. The argument random_state is used to initialize the pseudo-random number generator that is used for randomization.
kfold = KFold(n_splits=10, shuffle=True, random_state=1)
We are now using the cross_val_score() function to estimate the performance of the model. We are using the accuracy score here (What is the accuracy score in machine learning?)
The average accuracy score of the model will be like the following:
Accuracy: 0.7733595352016404








































0 Comments