random_state is used to initialize the pseudo-random number generator that is used by the algorithm.
result = cross_val_score(model, X, y, scoring="accuracy", cv=kfold)
print("Accuracy: ", result.mean())
The AdaBoost classifier works as mentioned previously. And the function cross_val_score() is used to evaluate the performance of the model. Here, we are calculating the accuracy score (What is an accuracy score in machine learning?) of the algorithm.
Please note that we will get an accuracy score for each iteration of the k-fold cross-validation. So, we are taking the average of all the accuracy scores and printing the result. The output of the above program will be like the following:
Accuracy: 0.7564764183185235








































0 Comments