TAI BUI
Back to curriculum
LearnPython

What Is Machine Learning

Machine learning replaces hand-written rules with patterns learned from data. Every algorithm in this phase, from a two-line nearest centroid classifier to a neural net, is a variation on that one idea.

TIME: ~45 minutesPREREQUISITES: Phase 1 (Math Foundations)

Learning Objectives

  • Explain the difference between supervised, unsupervised, and reinforcement learning and identify which type applies to a given problem
  • Implement a nearest centroid classifier from scratch and evaluate it against a random baseline
  • Distinguish between classification and regression tasks and select the appropriate loss function for each
  • Evaluate whether a given business problem is suitable for ML or better solved with deterministic rules

The Problem

Say you want to build a spam filter. The traditional approach: sit down and write hundreds of rules. "If the email contains 'FREE MONEY', mark it spam. If it has more than 3 exclamation marks, mark it spam." You spend weeks on this, then spammers change their wording, your rules break, and you write more rules. The cycle never ends.

Machine learning flips that. Instead of writing rules, you hand the computer thousands of labeled emails, "spam" or "not spam," and let it find the rules itself. It notices patterns you never would have thought to write down, and when spammers change tactics, you retrain on new data instead of rewriting code.

That's the real shift: from programming rules to learning them. Every recommendation engine, voice assistant, self-driving car, and language model runs on the same idea.

Warm-up0/3
1. Two points sit at (1, 1) and (4, 5) on a plane. What is the straight-line distance between them?Warm-up
A grid with two points labelled (1, 1) and (4, 5) joined by a dashed straight line, and a question mark asking for the distance.
2. You guess heads or tails at random for each of many flips of a fair coin. About what fraction of your guesses will be right?Warm-up
Two rows of boxes: a row of coin results H or T, and below it a row of guess boxes each holding a question mark. A question mark asks for the fraction of right guesses.
First ten coin results typed for illustration.
3. A mailbox holds 1,000 emails and 900 of them are not spam. A program labels every email 'not spam'. What share of its labels are right?Warm-up
A bar split into 900 not-spam emails (long blue part) and 100 spam emails (short red part). A question mark asks for the share of labels that are right when every email is labelled not spam.

The Concept

Learning From Data, Not Rules

Traditional programming and machine learning solve problems in opposite directions.

Mermaid diagram

Traditional programming: you write the rules, and the program applies them to data to produce output.

Machine learning: you provide the data and the outputs you expect, and the algorithm works out the rules itself.

The "model" that comes out of training IS the rules, encoded as numbers (weights, parameters). It generalizes from the examples it has seen to make predictions on data it has never seen.

The Three Types of Machine Learning

Mermaid diagram

Supervised Learning: You have input-output pairs. The model learns to map inputs to outputs.

  • "Here are 10,000 photos labeled cat or dog. Learn to tell them apart."
  • "Here are house features and prices. Learn to predict the price."

Unsupervised Learning: You have inputs only. No labels. The model finds structure on its own.

  • "Here are 10,000 customer purchase histories. Find natural groupings."
  • "Here are 1,000 dimensional data points. Reduce to 2 dimensions while keeping structure."

Reinforcement Learning: An agent takes actions in an environment and receives rewards or penalties. It learns a strategy (policy) to maximize total reward.

  • "Play this game. +1 for winning, -1 for losing. Figure out a strategy."
  • "Control this robot arm. +1 for picking up the object, -0.01 for each second wasted."

Most of what you will build in practice uses supervised learning. Unsupervised learning is common for preprocessing and exploration. Reinforcement learning powers game AI, robotics, and RLHF (reinforcement learning from human feedback, the technique that tunes language models toward what people prefer) for language models.

Beyond the Big Three

The three categories above are clean, but real-world ML often blurs the lines.

Semi-supervised learning uses a small set of labeled data and a large set of unlabeled data. You might have 100 labeled medical images and 100,000 unlabeled ones. Techniques include:

  • Label propagation: Build a graph connecting similar data points. Labels spread from labeled nodes to unlabeled neighbors through the graph.
  • Pseudo-labeling: Train a model on the labeled data, use it to predict labels for unlabeled data, then retrain on everything. The model bootstraps its own training set.
  • Consistency regularization: The model should give the same prediction for an input and a slightly perturbed version of that input. This works even without labels.

Self-supervised learning creates supervision from the data itself. No human labels needed at all. The model creates its own prediction task from the structure of the data.

  • Masked language modeling (BERT): Hide 15% of words in a sentence, train the model to predict the missing words. The "labels" come from the original text.
  • Contrastive learning (SimCLR): Take an image, create two augmented versions. Train the model to recognize they came from the same image while distinguishing them from augmented versions of other images.
  • Next-token prediction (GPT): Predict the next word given all previous words. Every text document becomes a training example.

These are not separate categories from the big three. They are strategies that combine supervised and unsupervised ideas. Self-supervised learning is technically supervised (the model predicts something), but the labels are generated automatically, not by humans.

Classification vs Regression

These are the two main supervised learning tasks.

AspectClassificationRegression
OutputDiscrete categoriesContinuous numbers
Example"Is this email spam?""What will the house price be?"
Output space{cat, dog, bird}Any real number
Loss functionCross-entropy, accuracyMean squared error, MAE
DecisionBoundaries between classesA curve that fits the data

Classification answers "which category?" Regression answers "how much?"

Some problems can be framed either way. Predicting if a stock goes up or down is classification. Predicting the exact price is regression.

The ML Workflow

Every machine learning project follows the same pipeline, regardless of the algorithm.

Mermaid diagram

Collect Data: Gather raw data. More data is almost always better, but quality matters more than quantity.

Clean & Explore: Handle missing values, remove duplicates, visualize distributions, spot anomalies. This step often takes 60-80% of total project time.

Feature Engineering: Transform raw data into features the model can use. Turn dates into day-of-week. Normalize numerical columns. Encode categorical variables. Good features matter more than fancy algorithms.

Split Data: Divide into training, validation, and test sets. The model trains on training data, you tune hyperparameters on validation data, and you report final performance on test data.

Train Model: Feed training data into an algorithm. The algorithm adjusts internal parameters to minimize a loss function.

Evaluate: Measure performance on validation/test data. If performance is not acceptable, go back and try different features, algorithms, or hyperparameters.

Deploy: Put the model into production where it makes predictions on new data.

Monitor: Track performance over time. Data distributions change (data drift), and models degrade. When performance drops, retrain.

Training, Validation, and Test Splits

This is the most important concept beginners get wrong. You must evaluate your model on data it has never seen during training. Otherwise you are measuring memorization, not learning.

Mermaid diagram

SplitPurposeWhen usedTypical size
TrainingModel learns from this dataDuring training60-80%
ValidationTune hyperparameters, compare modelsAfter each training run10-20%
TestFinal unbiased performance estimateOnce, at the very end10-20%

The test set is sacred. You look at it exactly once. If you keep adjusting your model based on test performance, you are effectively training on the test set and your reported numbers are meaningless.

For small datasets, use k-fold cross-validation: split data into k parts, train on k-1 parts, validate on the remaining part, rotate, and average results.

Overfitting vs Underfitting

Mermaid diagram

Underfitting: The model is too simple to capture the patterns in the data. A straight line trying to fit a curved relationship. Training error is high. Test error is high.

Overfitting: The model is too complex and memorizes the training data, including its noise. A wiggly curve that passes through every training point but fails on new data. Training error is low. Test error is high.

Good fit: The model captures real patterns without memorizing noise. Training error and test error are both reasonably low.

Signs of overfitting:

  • Training accuracy is much higher than validation accuracy
  • The model performs well on training data but poorly on new data
  • Adding more training data improves performance (the model was memorizing, not learning)

Fixes for overfitting:

  • Get more training data
  • Reduce model complexity (fewer parameters, simpler architecture)
  • Regularization (add a penalty for large weights)
  • Dropout (randomly zero out neurons during training)
  • Early stopping (stop training when validation error starts increasing)

Fixes for underfitting:

  • Use a more complex model
  • Add more features
  • Reduce regularization
  • Train longer

The Bias-Variance Tradeoff

This is the mathematical framework behind overfitting and underfitting.

Bias: Error from wrong assumptions in the model. A linear model has high bias when the true relationship is nonlinear. High bias leads to underfitting.

Variance: Error from sensitivity to small fluctuations in the training data. A model with high variance gives very different predictions when trained on different subsets of data. High variance leads to overfitting.

Model complexityBiasVarianceResult
Too low (linear model for curved data)HighLowUnderfitting
Just rightMediumMediumGood generalization
Too high (degree-20 polynomial for 10 points)LowHighOverfitting

Total error = Bias^2 + Variance + Irreducible noise

You cannot reduce irreducible noise (it is randomness in the data itself). You want to find the sweet spot where bias^2 + variance is minimized.

No Free Lunch Theorem

No algorithm wins on every problem. One that dominates on one class of tasks will lag on another, which is exactly why practitioners try several algorithms and compare results instead of betting on a favorite.

In practice, the choice depends on:

  • How much data you have
  • How many features there are
  • Whether the relationship is linear or nonlinear
  • Whether you need interpretability
  • How much compute you can afford

When NOT to Use Machine Learning

ML is powerful but not always the right tool. Before reaching for a model, ask whether you actually need one.

Do not use ML when:

  • Rules are simple and well-defined. Tax calculation, sorting algorithms, unit conversions. If you can write the logic in a few if-statements, a model adds complexity for no benefit.
  • You have no data or very little data. ML needs examples to learn from. With 10 data points, you cannot train anything meaningful. Collect data first.
  • The cost of being wrong is catastrophic and you need guaranteed correctness. Medical dosage calculation, nuclear reactor control, cryptographic verification. ML models are probabilistic. They will sometimes be wrong. If "sometimes wrong" is unacceptable, use deterministic methods.
  • A lookup table or heuristic solves the problem. If a simple threshold or table covers 99% of cases, adding ML increases maintenance cost without meaningful improvement.
  • You cannot explain the decision and explainability is required. Regulated industries (lending, insurance, criminal justice) sometimes require that every decision be fully explainable. Some ML models are interpretable (linear regression, small decision trees). Most are not.
  • The problem changes faster than you can retrain. If the rules change daily and retraining takes a week, the model is always stale.

Use this decision flowchart:

Mermaid diagram

Check: The Concept0/32
1. In supervised learning, what does the model receive during training?Define
A flow of three boxes: a dashed training-data box with a question mark, a model box, and a spam-or-not-spam output box.
2. In self-supervised learning, where do the training labels come from?Define
A table of three plain sentences, each with a question mark in the label column.
Typed example sentences.
3. What is a model in machine learning?Define
A new email goes into a dashed box labelled model, and the word spam comes out.
4. What happens during training?Define
Two small scatter plots of the same eight points. At the start of training a flat line sits far from the points; at the end a rising line runs through them. An arrow labelled training joins them.
Illustration: toy data, line from a gradient descent run in numpy.
5. What is a feature?Define
A table of four dates with columns date, day-of-week and units sold. The day-of-week column is outlined in orange with a question mark above it.
Typed illustrative sales figures.
6. What is a label?Define
A table of four houses with columns size, bedrooms and sale price. The sale price column is outlined in orange with a question mark above it.
Typed illustrative houses.
7. What is a hyperparameter?Define
A short code block with two lines, learning_rate = 0.01 and num_layers = 3, both outlined, and a question asking what such values are called.
Typed example lines.
8. What is a loss function?Define
A table of three houses with predicted price, actual price and a score column filled with question marks.
Typed illustrative prices in thousands of dollars.
9. What is overfitting?Define
Ten blue training points and an orange wavy curve that passes through every one of them.
Degree-9 polynomial fitted with numpy polyfit to seeded noisy data.
10. What is underfitting?Define
Thirty blue training points arranged in an arch, with a nearly flat orange straight line drawn through them.
Straight line (degree 1) fitted with numpy polyfit to seeded noisy data.
11. What is generalization?Define
Twenty blue training points with a rising orange line, and a dashed vertical marker for another input at 7.5, with a question mark for its prediction.
Toy data, line fitted with numpy polyfit.
12. What is cross-validation?Define
A dot plot of eight test accuracies, one row per run of the same classifier on the same 60 examples, spread over a noticeable range.
Nearest centroid from ml_intro.py on its synthetic data (separation 1.5, 60 examples), computed.
13. What is regularization?Define
Ten points with a wiggly degree-9 curve through them, next to the ten learned weights, several of them in the tens or hundreds.
Fitted with numpy polyfit on seeded noisy data.
14. What is data drift?Define
A grouped bar chart of a feature, exclamation marks per email, for two periods: blue bars for when the model was trained, concentrated at low counts, and orange bars for this month, shifted to higher counts.
Simulated counts (Poisson, seeded), for illustration.
15. In the ML workflow, which step typically consumes 60-80% of total project time?Define
Eight project steps in two rows of four, from Collect Data to Monitor, above a bar of total project time where a 60 to 80 percent part is marked for one unnamed step.
Schematic; the bar marks the 60-80% range from the question.
16. Which three terms add up to total model error in the bias-variance framework?Define
A stacked area chart over model complexity: a flat grey band at the bottom, a blue band shrinking as complexity grows, and an orange band growing, with a white line for their sum. The legend names them term A, B and C.
Illustrative curve shapes, typed.
17. What does the No Free Lunch theorem say about machine learning algorithms?Define
Two scatter plots with blue and orange points: Task 1 has two overlapping blobs and Task 2 has an orange ring around a blue blob. Text names two candidate algorithms.
Seeded synthetic data.
18. What is the purpose of splitting data into training and test sets?Explain
A bar with a large blue part A and a small orange part B, a note that the model is fitted using part A while part B is set aside, and a question asking why the data is cut.
Schematic; sizes not to scale.
19. Why does the lesson say the test set should be looked at exactly once, at the very end?Explain
A bar split into training, validation and test parts, above a timeline arrow from project start to project end with a question mark over the test set.
Schematic; sizes not to scale.
20. A team switches from predicting whether a stock goes up or down to predicting its exact price. What changes about the task?Explain
A line chart of ten daily closing prices with a dashed extension to tomorrow marked by a question mark.
Illustrative seeded random series, not real market data.
21. How does reinforcement learning differ from supervised learning in what the learner is given?Explain
An agent box and an environment box. A solid arrow labelled action goes from the agent to the environment, and a dashed arrow comes back with a question mark.
Schematic.
22. An e-commerce site wants to group customers into segments based on purchase behavior, with no predefined labels. Which type of ML is this?Apply
A scatter of 120 identical blue dots for customers, with purchases per month on one axis and average spend per order on the other, and a note that no column gives a group.
Seeded synthetic customers, axis scales omitted.
23. A robotics team wants a robot arm to learn, by trial and error, a strategy for picking up objects: +1 reward for a pickup, -0.01 for every second wasted. Which type of machine learning is this?Apply
A drawn robot arm with a base, two links and a gripper reaching an object, with text giving +1 for a pickup and -0.01 for every second wasted.
Schematic drawing; rewards as in the question.
24. A model predicts a continuous number, a house's sale price in dollars, instead of a category. Which task type is this, and which loss function fits it?Apply
A scatter of past house sizes against sale price in dollars, rising to the right, with a dashed vertical line for a new house whose price is a question mark.
Seeded synthetic sales; axis scales omitted.
25. Your dataset has only 200 labeled examples, too few to carve out a separate validation set without starving training. Which technique gives a reliable performance estimate without permanently giving up data to validation?Apply
A bar of 200 labeled examples, and below it the same bar split into a training part and a dashed validation part taken from the 200.
Schematic; the split sizes are not to scale.
26. Which scenario is NOT a good use case for machine learning?Apply
Two flows: rules and data into a program giving output, and data with known outputs into an algorithm giving rules.
The lesson's contrast between traditional programming and machine learning.
27. A model gets 98% accuracy on training data but 55% on test data. What is this an example of?Analyze
Two horizontal bars: accuracy on training data at 98 percent and on test data at 55 percent.
Numbers from the question.
28. A model scores 99% on training data and 60% on test data. Which change is most likely to help?Analyze
Two vertical bars: training accuracy 99 percent and test accuracy 60 percent, with the gap of 39 points noted.
Numbers from the question.
29. A spam filter scored well for months with no code changes, then accuracy fell after spammers changed their wording. Which idea explains it, and what is the usual response?Analyze
A line chart of a spam filter's monthly accuracy after deployment: high and flat for three months, then falling steadily after a dashed line where the spammers' wording changes.
Simulated stream of emails, numpy, seed 12; the filter is never modified.
30. A lender must compute a loan's monthly payment from principal, rate and term, and also flag likely fraud among millions of payments. Which design fits?Design
Two side-by-side cards: a monthly payment task taking principal, rate and term and returning the payment, and a fraud task taking millions of payments and flagging likely fraud.
31. A pricing policy changes every day, and retraining a model on the new policy would take a week. Which design fits best?Design
A row of eight daily policies, policy 1 to policy 8, with a bar below spanning days 1 to 7 labelled retraining takes a week, and a question about the policy in force on day 8.
Schematic timeline built from the question.
32. You have 100 labeled medical images and 100,000 unlabeled ones. Which approach uses all the data?Design
Two boxes: 100 labeled medical images in green and 100,000 unlabeled images with a dashed border.

Build It

The code in code/ml_intro.py implements a nearest centroid classifier from scratch, the simplest possible ML algorithm. It demonstrates the core idea: learn from data, then predict on new data.

Step 1: Nearest Centroid Classifier from Scratch

The nearest centroid classifier computes the center (mean) of each class in the training data. To predict, it assigns each new point to the class whose center is closest.

python
class NearestCentroid:
    def fit(self, X, y):
        self.classes = np.unique(y)
        self.centroids = np.array([
            X[y == c].mean(axis=0) for c in self.classes
        ])
 
    def predict(self, X):
        distances = np.array([
            np.sqrt(((X - c) ** 2).sum(axis=1))
            for c in self.centroids
        ])
        return self.classes[distances.argmin(axis=0)]

That is the entire algorithm. Fit computes two means. Predict computes distances. No gradient descent, no iteration, no hyperparameters.

Step 2: Train on Synthetic Data

We generate a 2D classification dataset with two classes that overlap slightly. The centroid classifier draws a linear decision boundary between the class centers.

python
rng = np.random.RandomState(42)
X_class0 = rng.randn(100, 2) + np.array([1.0, 1.0])
X_class1 = rng.randn(100, 2) + np.array([-1.0, -1.0])
X = np.vstack([X_class0, X_class1])
y = np.array([0] * 100 + [1] * 100)

Step 3: Compare Against a Baseline

Every ML model should be compared against a trivial baseline. Here, the baseline predicts a random class. If your ML model does not beat random guessing, something is wrong.

python
baseline_preds = rng.choice([0, 1], size=len(y_test))
baseline_acc = np.mean(baseline_preds == y_test)

The centroid classifier should get around 90%+ accuracy on this clean dataset. Random baseline gets around 50%.

Why This Matters

The nearest centroid classifier is about as simple as a learning algorithm gets, and it still captures the fundamental ML pattern:

  1. Learn a representation from training data (the centroids)
  2. Predict on new data using that representation (nearest distance)
  3. Evaluate against a baseline (random guessing)

Every ML algorithm, from logistic regression to transformers, follows this same three-step pattern. The representation gets more complex, but the workflow stays the same.

Step 4: What the Centroid Classifier Cannot Do

The nearest centroid classifier assumes each class forms a single blob. It draws linear decision boundaries. It fails when:

  • Classes have multiple clusters (e.g., the digit "1" can be written in several different ways)
  • The decision boundary is nonlinear (e.g., one class wraps around another)
  • Features have very different scales (distance is dominated by the largest-scale feature)

These limitations motivate every other algorithm you will learn. K-nearest neighbors handles multiple clusters. Decision trees handle nonlinear boundaries. Feature scaling fixes the scale problem. Each lesson builds on the limitations of the previous one.

Check: Build It0/5
1. In Build It, why is a baseline accuracy from random label guesses computed before trusting the centroid classifier's accuracy?Explain
A terminal excerpt of the Build It output with a Nearest Centroid row of train and test accuracy and a Random Baseline row whose test value is a question mark.
Real ml_intro.py output (excerpt); the baseline value is hidden.
2. In the from-scratch NearestCentroid implementation, what does the fit() method compute?Apply
A scatter of three blue class-0 points in the upper right and three orange class-1 points in the lower left, with a fit(X, y) box and a question mark asking what it computes.
Six typed points.
3. After fit() on the Build It data, the class 0 centroid is near (1, 1) and the class 1 centroid is near (-1, -1). What does predict() return for the new point (0.4, 0.2)?Apply
A plane with two diamond markers for the class 0 centroid near (1, 1) and the class 1 centroid near (-1, -1), and a new point at (0.4, 0.2); a question mark asks what predict returns.
Centroids as given in the question.
4. A nearest centroid classifier is run on a clean two-class dataset like the one in Build It, where the lesson expects around 90%+ accuracy, but it scores 52% against a random baseline near 50%. What should you conclude?Analyze
Two horizontal bars: random baseline at 50 percent and the classifier at 52 percent, with a dashed marker at 90 percent for what the lesson expects on this dataset.
Numbers from the question.
5. One class forms a ring around the other class in a 2D dataset, and the nearest centroid classifier does poorly. What is the most direct reason?Analyze
A scatter with a compact blue class in the middle and an orange class forming a ring around it.
Seeded synthetic data.

Use It

sklearn provides NearestCentroid and synthetic data generators:

python
from sklearn.neighbors import NearestCentroid
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
 
X, y = make_classification(
    n_samples=500, n_features=2, n_redundant=0,
    n_clusters_per_class=1, random_state=42
)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
 
clf = NearestCentroid()
clf.fit(X_train, y_train)
print(f"Accuracy: {clf.score(X_test, y_test):.3f}")
Check: Use It0/1
1. In the Use It section, what does sklearn's NearestCentroid.score() return when called as clf.score(X_test, y_test)?Apply
Three lines of the Use It code: creating NearestCentroid, fitting on the training data, and calling score on the test data, with a question mark for the result.
Lines copied from the lesson's Use It code.

Ship It

This lesson produces outputs/prompt-ml-problem-framer.md, a prompt that turns vague business problems into concrete ML tasks. Give it a problem description ("we want to reduce churn" or "predict demand for next quarter") and it identifies the learning type, defines the prediction target, lists candidate features, picks a success metric, establishes a baseline, and flags pitfalls like data leakage or class imbalance. Use it at the start of any ML project to avoid building the wrong thing.

Check: Ship It0/1
1. What does the prompt-ml-problem-framer output produced in Ship It help you do?Define
A quoted request, we want to reduce churn, goes into a box named prompt-ml-problem-framer, and a dashed output box comes out.
Author's Note

The section people skim past here is "When NOT to Use Machine Learning," and it's the one I'd make everyone read twice. Early in my career I watched a team spend a quarter building a model to route support tickets. A dozen keyword rules covering most of the volume would have shipped in a week and stayed easier to debug when something went wrong. The model wasn't wrong to build eventually. It was wrong to build first, before anyone had proven the simple rules couldn't get most of the way there on their own.

The other habit worth building now, while the stakes are low: write the random-baseline comparison before you write the model. Every result in this lesson gets checked against "what does guessing get you," and that single habit catches more broken pipelines than any amount of hyperparameter tuning. If your fancy model can't beat a coin flip, the bug is upstream of the algorithm.

Key Terms

TermWhat people sayWhat it actually means
Model"The AI"A mathematical function with learnable parameters that maps inputs to outputs
Training"Teaching the AI"Running an optimization algorithm to adjust model parameters so predictions match known outputs
Feature"An input column"A measurable property of the data that the model uses to make predictions
Label"The answer"The known output for a training example, used to compute the error signal
Hyperparameter"A setting you tweak"A parameter set before training that controls the learning process (learning rate, number of layers)
Loss function"How wrong the model is"A function that measures the gap between predicted and actual outputs, which training tries to minimize
Overfitting"It memorized the test"The model learned training-specific noise instead of general patterns, so it fails on new data
Underfitting"It didn't learn anything"The model is too simple to capture the real patterns in the data
Generalization"It works on new data"The model's ability to make accurate predictions on data it was not trained on
Cross-validation"Testing on different chunks"Repeatedly splitting data into train/test folds and averaging results, giving a steadier performance estimate
Regularization"Keeping weights small"Adding a penalty term to the loss function that discourages overly complex models
Data drift"The world changed"The statistical distribution of incoming data shifts over time, degrading model performance

Exercises

  1. Take any dataset (e.g., Iris, Titanic). Split it 70/15/15 into train/validation/test. Explain why you should not tune hyperparameters on the test set.
  2. List three real-world problems. For each one, identify whether it is classification, regression, or clustering, and whether it is supervised or unsupervised.
  3. A model gets 99% accuracy on training data but 60% on test data. Diagnose the problem and list three things you would try to fix it.

Further Reading

Code

Ships With