Where to Go Next

Look back at the whole course as the steps of one machine learning project, from deciding whether a model fits the question to watching it after it's in use, see plainly what the course left out, such as neural networks, text, images and forecasting, and find the ask-codey course that builds on it.

Journeyman · AI Basics · Python · Updated

By

After this lesson you can

  • Put the steps of a machine learning project in order, from the question to watching the model after it's in use, and say what each step guards against

Key takeaways

  • A project runs from the question to the model in use. Decide if a model fits, split the data, beat a baseline, measure honestly, explain, check groups, save, describe, and watch it.
  • The steps that keep a model honest are the ones that come before and after training. Training is one line of code.
  • This course left out neural networks and deep learning, gradient boosting in depth, text, images and forecasting over time, and the math behind each method.

At the start of this course, a model was a guess learned from examples, and you weren't sure when one would help. Now you can build one, measure it honestly, explain it, check how it treats different groups, save it and say where it must not be used. That's the work of anyone asked to "add some machine learning" to a product, a research project or a class assignment, and it's more than many people who train models do.

This lesson puts the whole course in one picture, says plainly what it left out, and names the ask-codey course that builds on it.

What you can do now

Module by module, you can:

  • Decide whether a model fits (Module 1): a rule or a query is often better; a model needs examples with answers, or a question about groups, and enough data. You can describe a column with its mean, median, spread and correlation.
  • Predict a number (Module 2): fit a line, a curve or a regression tree, split before anything learns, and measure the error in the label's units with the MAE, the RMSE and R squared, against a baseline.
  • Predict a category (Module 3): logistic regression, decision trees and nearest neighbors, counted with the confusion matrix, precision and recall, with a threshold chosen by what each mistake costs.
  • Measure honestly (Module 4): cross-validation, a test set kept for last, every step in a pipeline so nothing leaks, and settings tuned and models compared on the same folds.
  • Find groups, explain and check (Module 5): k-means for data without labels, permutation importance and partial dependence for what a model leans on, each group's rates for fairness, and this chapter's drift checks, saved pipelines and model cards.

One project, start to finish

Put together, the course is the steps of one project. Training is the shortest of them; the others are what make a model worth trusting:

  1. The question. Is a model the right tool, and is it regression, classification or finding groups? Guards against building a model where a rule would do.
  2. The data. Choose the features and the label, look at each column, and split before anything learns. Guards against testing on what the model already saw.
  3. A baseline. The simplest fair guess, scored the same way. Guards against a score that only sounds good.
  4. Models, compared fairly. A pipeline, cross-validation on the same folds, and one final test score. Guards against leaks and lucky splits.
  5. An explanation. What the model leans on, and how it does for each group of people it affects. Guards against a model nobody can question.
  6. A saved model and its card. The whole pipeline, its versions, and what it's for and not for. Guards against a model used where it was never meant to be.
  7. Watching it. Drift checks on new rows, the error on new answers, and retraining. Guards against a world that changed while nobody looked.

Try it: pick one of the course's datasets you haven't finished with, such as Harbor View Inn's bookings or Greenway Home Energy's bills, and take it through all seven steps on your own. When you can write its model card without guessing at any line, you've used the whole course.

What this course left out

A course has to stop somewhere. These are real parts of machine learning that this one doesn't teach:

  • Neural networks and deep learning: models built from many layers of simple units, behind image recognition and chatbots.
  • Gradient boosting in depth, support vector machines, naive Bayes, and other ways of finding groups (DBSCAN, hierarchical clustering).
  • Making fewer features from many (principal component analysis, PCA).
  • Text and images: each needs its own ways of turning words or pixels into features.
  • Forecasting over time (time series): next month's sales from past months, which needs splits and features of its own.
  • ROC curves and AUC, another way to judge a classifier across every threshold.
  • The math behind the methods: gradients, matrix algebra and likelihoods. The lessons said each idea in words and named its textbook term, so you can match them to a class.
  • Building apps with large language models, and laws about automated decisions: both are outside this course.

Where to go next on ask-codey

This course builds on what you can do now:

  • Data Structures and Big-O, Demystified: how the way data is organized decides how fast code runs as the data grows, with every sample in Python and four other languages.

Check yourself

2 questions to try on the lesson page.

So what

A model is one line of code; a model people can trust is every step around it, and you can now take a question all the way from "should we use machine learning?" to a model in use that someone keeps an eye on.

Sources

  • scikit-learn 1.9.1, User Guide: the supervised and unsupervised methods scikit-learn covers, including support vector machines, naive Bayes, gradient boosting, other clustering methods (DBSCAN, hierarchical clustering) and principal component analysis.
  • scikit-learn 1.9.1, Metrics and scoring, User Guide: the receiver operating characteristic (ROC) curve and the area under it (AUC).

Key terms

Related