beginner · python

Intro to Machine Learning

Build an intuitive foundation in machine learning, including models, features, loss, training, and generalization. Use Python and scikit-learn to reason about supervised and unsupervised learning, evaluate models, and improve their performance.

What you could build

  • A house-price predictor using regression and carefully selected evaluation metrics.
  • A spam-message classifier using text features and supervised learning.
  • A customer-segmentation analysis using clustering and dimensionality reduction.
  • A recommendation baseline that compares simple similarity-based approaches.
  • A model-comparison notebook that examines overfitting, feature choices, and cross-validation.

You pick the project at the start — these are examples, not a fixed list.

What you'll be able to do

  • Frame a machine learning task by identifying its features, labels, target type, available information, and evaluation goal.
  • Train and compare regression and classification models in Python using appropriate metrics such as mean squared error, accuracy, precision, recall, and F1 score.
  • Diagnose overfitting and underfitting, then improve generalization with validation, cross-validation, feature scaling, regularization, and hyperparameter search.
  • Apply clustering, dimensionality reduction, and anomaly-detection concepts to reason about structure when labeled targets are unavailable.
  • Critically interpret model predictions by examining thresholds, calibration, errors, distribution shift, assumptions, and limitations.

Who this is for

This course is for learners who know basic Python and want a clear, intuitive foundation in machine learning. It fits anyone who wants to understand how models learn, evaluate predictions responsibly, and use scikit-learn without treating the library as a black box.

What you should already know

  • Basic Python syntax, including variables, functions, conditionals, loops, and importing libraries.
  • Familiarity with basic algebra, including averages, differences, multiplication, and reading simple graphs.
  • Comfort working with tabular data and using a Python environment such as Jupyter or an equivalent notebook.

How a lesson actually goes

Lesson 1
TutorWelcome to Intro to Machine Learning. We will start by separating what a model receives as input from what it is asked to predict, then connect those ideas to training, loss, evaluation, and generalization.
YouI have used Python, but I mostly think of machine learning as choosing an algorithm and giving it data. I am not sure what makes that different from a normal program.
TutorThat is a useful starting point. In an explicitly programmed system, you write rules that map inputs to outputs; in machine learning, you provide examples and a model-learning procedure that adjusts parameters to find a useful mapping. Can you think of one piece of information that might be an input feature rather than a prediction target?
YouIf we were predicting a numeric outcome, the measurements used to make the prediction would be features. The outcome itself would be the label, although I sometimes use those terms interchangeably.
TutorYou have the distinction right: features describe the available input, while a label is the target value supplied during supervised learning. Let us make it precise with a small table: if each row represents one observation and one column is the value we want to predict, which columns could the model use during prediction, and which one must it learn to estimate?
YouThe feature columns could be used during prediction, and the target column is the one the model estimates. I assume the target should not be included among the features, because that would give the answer away.

Written from this course's first lesson to show the format — not a recording of a real session.

Course content

marks each module's capstone lesson.

01Foundations and Workflow11 lessons

Establish the core vocabulary and workflow of machine learning, from representing data with features and labels to training, evaluating, and reasoning about model generalization.

  • Course Introduction

    Welcome and orientation: overview of the learning path, key outcomes, and how modules build on each other.

  • Machine Learning

    Machine learning uses data to infer patterns that support predictions or decisions. This lesson introduces the role of data, models, and learning procedures.

  • Features

    Features are measurable input variables used to describe examples. Their values provide the information from which a model learns patterns.

  • Labels

    A label is the target outcome associated with an example. Supervised learning uses labeled examples to connect input features with desired outputs.

  • Dataset Splits

    Dataset splits separate the examples used to fit a model from those used to estimate performance on unseen data. This separation helps make evaluation more informative.

  • Models

    A model represents a relationship between inputs and outputs through parameters or rules. Different model types make different assumptions about how that relationship can be represented.

  • Loss Functions

    A loss function quantifies how far predictions are from their target values. Lower loss indicates better agreement according to the chosen error measure.

  • Training

    Training is the process of using examples and a loss function to select model parameters. The training procedure searches for parameter values that improve the model's predictions.

  • Evaluation

    Evaluation measures how well a trained model performs on data not used to fit its parameters. Metrics summarize performance in a form suited to the prediction task.

  • Generalization

    Generalization is the ability to make useful predictions on unseen examples. A model that performs well on training data but poorly on new data may have overfit.

  • Machine Learning Workflow

    This capstone assesses the complete reasoning chain from features and labels through training and held-out evaluation. Learners explain how each stage contributes to building models that perform well beyond the training examples.

02Supervised Learning9 lessons

Learn how labeled examples support prediction, how regression and classification differ, how common supervised models produce predictions, and how to evaluate those predictions with appropriate metrics.

  • Supervised Learning

    Supervised learning fits a model using input features paired with known labels. The trained model uses the learned relationship to predict labels for new feature values.

  • Regression

    Regression predicts quantities that can take numerical values, such as measurements or prices. Its predictions are evaluated by comparing predicted and actual numeric values.

  • Classification

    Classification predicts membership in one or more discrete categories. A classifier may produce a class label directly or scores that are converted into class predictions.

  • Linear Regression

    Linear regression predicts a numeric value by combining features with learned weights and an intercept. Training selects these parameters to reduce prediction error according to a loss function.

  • Logistic Regression

    Logistic regression applies a transformation to a linear combination of features so that the output can represent a probability. A decision threshold can then convert that probability into a class prediction.

  • Nearest Neighbors

    A nearest-neighbors model predicts from training examples that are close to a new example according to a distance measure. The number of neighbors controls how local or broad the prediction is.

  • Accuracy

    Accuracy is the proportion of classification predictions that match the true labels. It summarizes overall correctness but can be misleading when class frequencies are uneven.

  • Mean Squared Error

    Mean squared error averages the squared differences between predicted and actual numeric values. Squaring makes larger errors contribute disproportionately to the overall score.

  • Supervised Learning Synthesis

    Synthesize supervised learning concepts by determining whether a prediction problem is regression or classification, reasoning about how a suitable model generates predictions, and interpreting an appropriate evaluation metric.

03Evaluation and Metrics12 lessons

Develop a reliable framework for evaluating machine learning models by separating validation from testing, interpreting classification and regression metrics, detecting data leakage, and selecting metrics that match the evaluation goal.

  • Validation Sets

    A validation set provides held-out data for comparing models or tuning choices during development. Keeping the test set separate preserves an unbiased final estimate of generalization.

  • Cross-Validation

    Cross-validation repeatedly divides the available training data into complementary training and validation folds. Averaging the validation results gives a more stable performance estimate than relying on one split.

  • Baseline Models

    A baseline makes simple predictions using a rule such as the majority class or the average target value. Model performance should be interpreted relative to this reference rather than in isolation.

  • Confusion Matrices

    A confusion matrix organizes predictions into true positives, true negatives, false positives, and false negatives. These counts reveal the types of classification errors that a single overall score can hide.

  • Precision

    Precision focuses on the reliability of positive predictions. It decreases when false positives make up a larger share of all predicted positives.

  • Recall

    Recall measures how successfully a model finds the positive cases that truly exist. It decreases when false negatives account for a larger share of the actual positives.

  • F1 Score

    The F1 score rewards classifiers that maintain both precision and recall and becomes low when either one is low. It is useful when a balanced view of false positives and false negatives is more informative than accuracy alone.

  • Mean Absolute Error

    Mean absolute error averages the absolute differences between predicted and actual numeric values. Its units match the target, making the typical prediction error relatively direct to interpret.

  • R-Squared

    R-squared indicates how much better a regression model explains variation than predicting the mean target value. Its value depends on the comparison baseline and can be negative when the model performs worse than that baseline.

  • Metric Selection

    Metric selection requires considering whether the task is classification or regression and which errors matter most. Different metrics emphasize different aspects of performance, so no single score is universally appropriate.

  • Data Leakage

    Data leakage occurs when information unavailable at prediction time influences training or model selection. Leakage can enter through features, preprocessing, or split procedures and causes evaluation results to overstate generalization.

  • Evaluation and Metrics Synthesis

    A reliable evaluation connects validation strategy, baselines, error patterns, metric definitions, and the risks of leakage. This synthesis requires reasoning about whether reported performance is trustworthy and whether the chosen metrics reflect the modeling goal.

04Generalization and Tuning11 lessons

Learn how model complexity affects generalization, how overfitting and underfitting appear, and how regularization, preprocessing, and systematic hyperparameter search improve model performance without compromising evaluation validity.

  • Overfitting

    Overfitting occurs when a model captures training-specific patterns that do not generalize to new data. Learners compare training and held-out performance to recognize this pattern.

  • Underfitting

    Underfitting occurs when a model is too limited to capture important patterns in the data. It typically produces poor performance on both training and held-out examples.

  • Model Complexity

    Model complexity describes how flexible a model is in representing relationships between features and targets. Increasing complexity can reduce training error while eventually making predictions more sensitive to training-specific variation.

  • Regularization

    Regularization adds a constraint or penalty that discourages extreme parameter values and reduces effective model flexibility. The regularization strength controls the tradeoff between fitting the data and limiting complexity.

  • Hyperparameters

    Hyperparameters are choices set before training, such as a regularization strength or the number of neighbors. Unlike model parameters, they are selected by comparing model performance across validation procedures.

  • Learning Curves

    Learning curves show training and validation performance as the amount of training data changes. The relationship between the curves helps distinguish high bias from high variance and indicates whether more data may help.

  • Feature Scaling

    Feature scaling puts numeric features on comparable scales so that large-unit features do not dominate calculations. This is especially important for distance-based and parameterized models whose behavior depends on feature magnitude.

  • Preprocessing Pipelines

    A preprocessing pipeline links transformations and model fitting into one repeatable procedure. During validation, each transformation is fit only on the corresponding training portion and then applied to the validation portion.

  • Grid Search

    Grid search evaluates every specified combination in a hyperparameter grid, typically using cross-validation. It provides a systematic comparison when the candidate values and search space are manageable.

  • Random Search

    Random search samples hyperparameter combinations from specified distributions or ranges rather than evaluating every combination. It can cover influential dimensions more broadly when the search space is large or unevenly important.

  • Tuning and Generalization Synthesis

    This synthesis connects fit diagnosis, model complexity, regularization, preprocessing, and hyperparameter search into a reliable tuning process. Learners reason from training and validation evidence to select adjustments while preserving an unbiased final test evaluation.

05Finding Hidden Structure9 lessons

Learn how unsupervised learning discovers patterns in data without target labels, including clustering, cluster evaluation, dimensionality reduction, and anomaly detection.

  • Unsupervised Learning

    Unsupervised learning analyzes feature data when no target labels are provided. Its goal is to reveal patterns, groups, or unusual observations rather than predict a known outcome.

  • Clustering

    Clustering assigns observations to groups whose members are more similar to one another than to members of other groups. The meaning of each group must be interpreted from the features used to form it.

  • K-Means

    K-means alternates between assigning observations to their nearest centroid and updating each centroid to represent its assigned observations. The process seeks compact clusters based on the selected number of groups.

  • Hierarchical Clustering

    Hierarchical clustering builds a tree-like representation of relationships among observations or groups of observations. A desired grouping can be selected by cutting the hierarchy at a chosen level.

  • Silhouette Score

    The silhouette score compares an observation's similarity to its own cluster with its similarity to the nearest alternative cluster. Higher values generally indicate clusters that are more cohesive and better separated.

  • Dimensionality Reduction

    Dimensionality reduction transforms a dataset into a smaller number of dimensions that capture selected aspects of its original structure. Fewer dimensions can simplify visualization, computation, and pattern analysis.

  • Principal Component Analysis

    Principal component analysis constructs new, mutually uncorrelated features called principal components. The first components capture the greatest variation in the data, allowing a lower-dimensional representation to retain prominent patterns.

  • Anomaly Detection

    Anomaly detection assigns attention to observations that are unusually isolated, distant, or inconsistent with the rest of the data. Because labels are often unavailable, the interpretation of an anomaly depends on the data representation and detection method.

  • Unsupervised Learning Synthesis

    Synthesize unsupervised learning concepts to reason about when to group observations, assess cluster quality, reduce dimensionality, or identify unusual cases. Compare the assumptions and interpretations of different approaches while recognizing that unsupervised results do not come with known target labels.

06Integrated Model Reasoning9 lessons

Integrate the course's concepts into a disciplined way of framing machine learning problems, selecting models, interpreting predictions, diagnosing errors, and reasoning about how performance may change outside the evaluation data.

  • Problem Framing

    Problem framing converts an informal question into a precise machine learning task. A useful framing specifies what is predicted, which information is available at prediction time, and what counts as successful performance.

  • Inductive Bias

    Inductive bias consists of the assumptions a learning method makes about useful patterns in data. These assumptions help a model generalize from limited examples but can also make it poorly suited to a particular structure.

  • Model Selection

    Model selection compares plausible learning methods using evidence from validation while considering the target type, feature representation, scale, and relevant tradeoffs. The best choice is not necessarily the most complex or highest-scoring model in one split.

  • Decision Thresholds

    A classification model can produce a probability or score before a final class decision is made. The decision threshold determines which scores become positive predictions and therefore changes the types of errors made.

  • Probability Calibration

    A calibrated probability reflects how often an outcome occurs among cases assigned that probability. Calibration is distinct from ranking quality or classification accuracy and matters when probability values themselves guide decisions.

  • Error Analysis

    Error analysis examines incorrect or high-loss predictions rather than relying only on an aggregate metric. Grouping errors by relevant characteristics can reveal systematic weaknesses and suggest which part of the workflow needs attention.

  • Distribution Shift

    Distribution shift occurs when the data encountered after evaluation differs from the data used to train or assess a model. Even a model that performs well on held-out data can fail when feature patterns, target frequencies, or feature-target relationships change.

  • Model Limitations

    Model limitations are the conditions under which a model's conclusions may be unreliable or incomplete. Reasoning about limitations requires separating what the evaluation demonstrates from what it does not establish.

  • Integrated Model Reasoning

    Integrated model reasoning connects the full workflow from defining a task to deciding whether model evidence supports a conclusion. It requires weighing data representation, model behavior, validation results, error patterns, probability interpretation, and conditions that may weaken generalization.

Questions

Do I need prior machine learning experience?

No. The course begins with features, labels, models, loss, training, evaluation, and generalization, then builds toward model selection and integrated reasoning.

How much Python do I need?

You should be able to read and write basic Python and use imports. The course uses Python and scikit-learn to reinforce machine learning concepts rather than teaching programming from the beginning.

Will I learn both supervised and unsupervised learning?

Yes. You will study regression and classification, then move to clustering, dimensionality reduction, and anomaly detection, including how to evaluate each kind of result.

Will the course explain how to choose the right metric?

Yes. You will work with accuracy, precision, recall, F1, mean squared error, mean absolute error, and R-squared, and learn to match metrics to prediction goals and error costs.

Does the course cover model improvement and troubleshooting?

Yes. It covers validation, cross-validation, baselines, leakage, overfitting, underfitting, regularization, feature scaling, preprocessing pipelines, grid search, random search, and error analysis.

The first lesson is ten minutes away.

Free while codeset is early. You choose what you're building before the first lesson starts, and the course is taught around it.

Start this course

Other courses