Solution: Model Evaluation
Explore how to evaluate machine learning classification models using the F1 score and k-fold cross-validation. Understand how to apply logistic regression, k-nearest neighbors, and decision trees, compare their performance, and select the best model based on average scores across folds.
We'll cover the following...
We'll cover the following...
There are multiple possible solutions for the model selection coding challenge, depending on the cross-validation methods we choose, but the important thing is to do the following:
Choose an appropriate metric for a classification task.
Use a cross-validation method to select the best model.
Here is one possible solution:
Lines 10–17: We initialize three different classification ...