Skip to content
FORGENO ADS GAMESUnlock all $8

Machine Learning Fundamentals · Unit 1 of 8

Unit 1: What machine learning is

Learning from examples instead of rules, the main kinds of machine learning, the workflow professionals follow, baselines, and when machine learning is the wrong tool.

Opens the first lesson of this unit in Machine Learning Fundamentals. Every lesson is open from the start.

Lesson 1: Learning from examples instead of rules

Goal: Explain what a model, its parameters, training and inference are.

Ordinary software follows rules a programmer wrote. Machine learning (ML) builds software differently: you give a program many examples, and it adjusts its own internal numbers until its outputs match those examples. The result is a model: a function that takes inputs and produces a prediction, with parameters (the adjustable numbers) that were learned from data rather than typed in by a person.

Worked example: pricing used bikes, two ways

  1. Rule-based: a shop owner writes "a used bike is worth half its new price, minus 10% for each year of age". It is quick, but it ignores brand, condition and season.
  2. Learned: the shop collects 2,000 past sales with age, brand, condition, season and the price each bike actually sold for. A model adjusts its parameters until its predictions are close to those real prices.
  3. A new bike comes in. The model weighs every input at once and predicts a price. Nobody gave it the rule; it found the pattern in the data.

Rules capture what a person already knows. Learning captures patterns in data, including ones nobody ever wrote down.

Three words come up constantly. Training is the process of adjusting the parameters to fit examples. Inference (or prediction) is using the finished model on new inputs. Generalization is how well the model does on inputs it never saw during training. Generalization is the whole point: a model that works only on its training examples is useless.

This course builds the core ideas with small, honest examples and hands-on labs: what data a model needs, how to test it fairly, four classic methods (k-nearest neighbours, linear regression, logistic regression and decision trees), the metrics professionals use, how models go wrong, and how the neural networks behind today's AI systems are the same recipe at enormous scale.

Machine learning (ML)
Building software that learns patterns from example data instead of following only hand-written rules.
Model
A function learned from data that turns inputs into predictions.
Parameter
An adjustable number inside a model whose value is learned during training.
Training
Adjusting a model's parameters so its outputs fit example data.
Inference
Using a trained model to make predictions on new inputs.
Generalization
How well a model performs on data it did not see during training.

Remember: A model is a function with learned parameters. Its value is in how well it generalizes to new data.

Lesson 2: Kinds of machine learning

Goal: Tell classification, regression, clustering and reinforcement learning apart.

Supervised learning learns from examples that come with the right answer, called the label. If the label is a category (spam or not spam, which of five products), the task is classification. If the label is a number (a price, a delivery time), the task is regression.

Unsupervised learning has no labels. It finds structure on its own, such as clustering customers into groups with similar habits. Reinforcement learning learns by trial and error from rewards, as in game-playing systems and some robotics. This course focuses on supervised learning, the kind behind most business models.

ProblemLabelType
Will this customer cancel next month?Yes or noSupervised classification
How many minutes will this delivery take?A numberSupervised regression
Which of 12 teams should this ticket go to?One of 12Supervised classification (multi-class)
Group 50,000 shoppers by buying habitsNoneUnsupervised clustering
A program learns a game by winning and losingRewardsReinforcement learning

Naming the task type is the first decision in any project, because it decides which methods and which metrics make sense. Many problems can be framed either way: "how many days until this customer cancels?" is regression, while "will they cancel within 30 days?" is classification. Choose the framing that matches the decision someone will actually make with the prediction.

Supervised learning
Learning from examples that include the correct answer (the label).
Label
The answer a supervised model learns to predict, also called the target.
Classification
Predicting a category.
Regression (task)
Predicting a number.
Unsupervised learning
Finding structure in data that has no labels.
Clustering
Grouping similar examples together without predefined labels.

Remember: Category label: classification. Number label: regression. No label: unsupervised.

Lesson 3: The machine learning workflow

Goal: Follow the professional workflow and always compare against a baseline.

Professional ML projects follow roughly the same steps, and most of the work is not training. Skipping a step is the most common way projects fail.

  1. Define the question and how success will be measured, in business terms.
  2. Collect and understand the data.
  3. Prepare features and labels (Unit 2).
  4. Split the data so some is held back for testing (Unit 3).
  5. Train a model, starting with something simple.
  6. Evaluate on the held-back data with the right metric (Unit 5).
  7. Deploy, then monitor, because the world changes.

Always compare against a baseline: the simplest possible prediction. For classification it is "always predict the most common class"; for regression, "always predict the average". If 95% of emails are not spam, a model that says "not spam" every time is 95% accurate and completely useless. Your model has to beat the baseline by enough to matter.

Worked example: the baseline that embarrassed a model

  1. A team builds a model to predict which customers will cancel. It is 88% accurate, and they are pleased.
  2. Baseline: 88% of customers never cancel. Predicting "stays" for everyone is also 88% accurate.
  3. The model has learned nothing useful yet. The team switches to a metric that counts how many cancellations it catches (recall, Unit 5) and goes back to work on the features.

Accuracy means nothing until you compare it with the baseline.

Baseline
The simplest reasonable prediction, such as always guessing the most common class, used as the bar a model must beat.
Deployment
Putting a model into real use.
Monitoring
Watching a deployed model's performance and inputs over time.

Remember: Most-common-class or average: that is your baseline. Beat it by enough to matter.

Lesson 4: When machine learning is the right tool

Goal: Decide between machine learning, ordinary code and human judgment.

Machine learning is powerful, but it is not always the right choice. It fits when there is a real pattern, enough examples to learn it, and tolerance for some errors.

Machine learning fitsUse something else
Patterns too complex to write as rules, such as recognizing handwritingThe rule is simple and known, such as sales tax: write the rule
Lots of labeled examplesOnly a handful of examples
Some errors are acceptable, or can be checkedEvery answer must be exactly right, such as payroll
The pattern stays fairly stable, or you can retrainYou need a guaranteed, fully explainable decision, for example by law

Worked example: rule or model?

  1. "Flag orders over 10,000 dollars for review" is a rule. Write it as one line of code.
  2. "Flag orders that look like fraud" has no simple rule: fraudsters change tactics and the signals are subtle combinations. That suits ML, with people reviewing the flagged orders.
  3. "Calculate overtime pay" must be exactly right and follow the law. That is code, not ML.

Use ML for fuzzy patterns, code for known rules, and people for accountable judgment.

Ask also who is affected. Models that make decisions about people, such as hiring, lending or medical triage, can be wrong in ways that are unfair to whole groups (Unit 8). That does not always rule ML out, but it raises the bar for testing, transparency and human oversight.

Explainability
How well people can understand why a model made a particular prediction.

Remember: Fuzzy pattern plus plenty of data plus tolerance for error: ML. Known rule or exactness required: code.

Practise it in Machine Learning Fundamentals

Each lesson ends with two or three questions that check you can use the idea, not just recognise it. Wrong answers explain why and come back in Review. The unit ends with a 6-question quiz; pass it with 80% or more to master the unit.

Every lesson is free: no ads, no lives and no paywall.