Single logo
  • Courses
  • Blog
  • About
Join for freeJoin free
  1. Blog
  2. /
  3. Learning paths
  4. /
  5. Choose and Tune a Model: Classic Algorithms to a Saved Pipeline

Learning path · 10 tutorials

Choose and Tune a Model: Classic Algorithms to a Saved Pipeline

Who it is for
Learners who can train and evaluate a logistic regression and want to know the other classic algorithms, tune them and ship the best one.
What you will achieve
Use KNN, Naive Bayes, SVM, decision trees, random forests, boosting and stacking, tune them with grid and random search, explain which features matter, and finish a classification project with a saved model.
Prerequisites
Scikit-learn Pipelines · Precision, recall, F1 and cross-validation
Start with step 1: K-Nearest Neighbours (KNN)

Curriculum

  1. 1
    Step 1: K-Nearest Neighbours (KNN): Distance, k and Why Scaling Is a Must

    Price a house from its three most similar neighbours, by hand and with KNeighborsRegressor, see scaling swap Pine for Birch, then pick k on the wine data with cross-validation: best k is 17 and the test accuracy is 1.0.

  2. 2
    Step 2: Naive Bayes: Prior Times Likelihood, a Spam Filter by Hand and GaussianNB

    Build a four-word spam filter by hand: prior 0.56 vs 0.44, a spam score of exactly zero, Laplace smoothing to fix it and logs so tiny numbers don't vanish. Then GaussianNB scores 0.967 on iris.

  3. 3
    Step 3: Support Vector Machines (SVM): The Widest Road, C, Kernels and gamma

    An SVM builds the widest road between two groups, and only the houses on the edge decide it. See C squeeze the road from 4.36 to 1.46, a kernel lift a dose problem from 0.67 to 1.0, gamma overfit two moons, and a scaled SVC reach 0.972 on wine.

  4. 4
    Step 4: Decision Trees: Gini, max_depth and Feature Importances on Rain in Australia

    A decision tree plays 20 questions with your data. Compute gini by hand, read a depth-2 rain tree that scores 0.82, watch an unlimited tree hit 1.000 on train and 0.770 on test, and see humidity take 65% of the importance.

  5. 5
    Step 5: Bagging and Random Forest: Many Shaky Trees, One Steady Answer

    Five single trees on bootstrap samples score between 0.75 and 0.769 on rain. A forest of 100 trees scores 0.85. See the bootstrap by hand, max_features picking 4 of 16 columns, and where adding trees stops helping.

  6. 6
    Step 6: Boosting: Residuals by Hand, AdaBoost, Gradient Boosting and XGBoost

    Each new small tree fixes what the team still gets wrong. Watch the MSE fall from 36.89 to 4.49 in three rounds on six kids, then AdaBoost 0.831, GradientBoosting 0.845 and XGBoost 0.846 on the rain data.

  7. 7
    Step 7: Voting and Stacking: Does a Team of Models Beat the Best One?

    Three different judges on the rain data: logistic regression 0.846, KNN 0.836, a tree 0.823. Hard and soft voting land in between; stacking reaches 0.848, just four more days right out of 2,000. An honest look at when a team helps.

  8. 8
    Step 8: Hyperparameter Tuning with GridSearchCV and RandomizedSearchCV

    Let scikit-learn try the settings for you. A random forest grid of 6 candidates (30 fits) lifts F1 from 0.558 to 0.630, and a random search of 10 out of 54 XGBoost combinations finds the same winner as the full grid, F1 0.649, in a third of the time.

  9. 9
    Step 9: Which Features Matter? Feature Importances, Permutation Importance and SHAP

    Ask a tuned rain model why. Tree importances show what the trees used, permutation importance shows what the score needs (shuffling Humidity3pm drops F1 from 0.637 to 0.453), and SHAP explains one day the model is 97% sure will rain.

  10. 10
    Step 10: Project: The Classification Master Template, from Raw CSV to a Saved Model

    One notebook that takes Rain in Australia from raw CSV to a tested, saved model: six models auditioned on the same folds, the best two tuned, a 0.4 threshold picked from out-of-fold probabilities, and one test run with AUC 0.872.

Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.