Why this matters
scikit learn is a widely used free Python library for classic machine learning, and adverts that name a library often name it. Its consistent pattern means once you can train one model, you can train dozens. More important than any single model is the habit of comparing against a baseline and measuring what matters for the decision.
Regression and classification
- Regression predicts a number: yield in kilograms, next month's sales, a household's water use.
- Classification predicts a category: repaid or late, will buy or not, high or low risk. Most classifiers also give a probability, which is often more useful than the label.
The scikit learn pattern
Every model follows the same steps: create it, fit on training data, then predict or predict_proba on new data. Keep some data aside that the model never sees during training, so you can test it fairly.
Here is a made up dataset of 2,000 borrowers with loan size, past late payments and months of membership, where about 17 percent paid late. X holds the three feature columns and holds the late flag (1 for late, 0 for on time):