Single logo
  • Courses
  • Blog
  • About
Join for freeJoin free
  1. Blog
  2. /
  3. Learning paths
  4. /
  5. Classify and Evaluate: Logistic Regression to Cross-Validation

Learning path · 7 tutorials

Classify and Evaluate: Logistic Regression to Cross-Validation

Who it is for
Learners who can prepare data and fit a regression model and now want to predict yes-or-no outcomes and judge them honestly.
What you will achieve
Understand the sigmoid, fit logistic regression in scikit-learn, see why accuracy misleads, measure precision, recall, F1 and ROC AUC, pick a threshold, handle imbalanced classes, and check a score with cross-validation.
Prerequisites
Basic Python and pandas · Train-test split and scikit-learn Pipelines
Start with step 1: Logistic Regression and the Sigmoid

Curriculum

  1. 1
    Step 1: Logistic Regression and the Sigmoid: Score, Squash, Decide

    How logistic regression turns a price into the probability of a car: why a straight line fails, Euler's number e, the sigmoid, the 0.5 threshold, the decision boundary and log loss, on eight vehicles.

  2. 2
    Step 2: Logistic Regression in scikit-learn: predict, predict_proba and Softmax

    Logistic regression as the last step of a scikit-learn pipeline on Rain in Australia: test accuracy, max_iter and ConvergenceWarning, predict vs predict_proba, then three Iris classes and softmax worked by hand.

  3. 3
    Step 3: Why Accuracy Lies: The Confusion Matrix, Baselines and Type I/II Errors

    On 20,000 card payments with 1% fraud, a model that never looks scores 99% accuracy and catches nothing. The confusion matrix shows what accuracy hides: 21 frauds caught, 29 missed.

  4. 4
    Step 4: Precision, Recall and F1 Score: Two Questions and One Balance

    Precision asks whether the model's yes is right; recall asks whether it found them all. Worked by hand and with scikit-learn on a fraud model with 99.4% accuracy and only 0.42 recall.

  5. 5
    Step 5: ROC Curve, AUC and Choosing a Classification Threshold

    The 0.5 cut is only a default. On 1% fraud data: slide the threshold, draw the ROC and precision-recall curves, read AUC 0.877, pick the best-F1 cut on validation data, then open the test part once.

  6. 6
    Step 6: Handling Imbalanced Data: class_weight, SMOTE and the Resampling Leak

    With 150 frauds among 15,000 training payments, a model learns to ignore fraud. Compare class_weight, random oversampling and SMOTE, see why full balance overshoots, pick a gentle SMOTE on validation data and avoid the resample-before-split leak.

  7. 7
    Step 7: Cross-Validation: KFold, StratifiedKFold, cross_val_score and cross_validate

    The same model on five different splits scores F1 from 0.52 to 0.63. Cross-validation replaces one lucky number with a mean and a spread: KFold vs StratifiedKFold, cross_val_score, cross_validate on four models, then one honest test.

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.