Laroo-Pece Division, Gulu City, Northern Uganda
Uganda time
Artificial intelligence - Advanced

Introduction to Machine Learning

Learn how machines learn from data: prepare data, train and judge regression, tree, nearest-neighbour and clustering models with scikit-learn, avoid overfitting and bias, and finish a complete project.

About this course

Machine learning (ML) is the part of computing where a program finds patterns in examples instead of following rules that a person wrote by hand. It powers spam filters, crop and weather forecasts, credit scoring for mobile lenders, medical image checks and many other tools that young Africans are already building and using.

This course teaches the ideas first and the code second. You will learn the main problem types, how to prepare data, how to split it honestly into training and test sets, and how to train linear and logistic regression, decision trees, random forests, k-nearest neighbours and k-means clustering using scikit-learn, the standard Python library for classic ML. You will measure models with accuracy, precision, recall, the confusion matrix and error scores, and learn why a model that looks perfect on its own data can still fail in real life.

The course ends with a full project, a serious look at bias and ethics, and practical ideas for putting a model to work. It assumes you have finished the Data Analysis with Python course and are comfortable with pandas and NumPy. Small examples are worked by hand so you can check every output; where a result depends on randomness or on your library version the lesson tells you so.

What you will learn

  • Explain the difference between supervised, unsupervised and other kinds of machine learning and choose the right problem type for a real question.
  • Prepare data for a model: handle missing values, encode categories, scale numbers and separate features from the label.
  • Split data into training and test sets and use a baseline to judge whether a model is any good.
  • Train and use linear regression, logistic regression, decision trees, random forests and k-nearest neighbours with scikit-learn.
  • Group unlabelled data with k-means clustering and choose a sensible number of clusters.
  • Evaluate models with accuracy, precision, recall, the confusion matrix, MSE and cross-validation, and recognise overfitting.
  • Build and report a complete scikit-learn project using a pipeline.
  • Describe sources of bias, privacy risks and basic ways to save, serve and monitor a trained model.

Course content

5 modules · 17 lessons · 4 h 46 min · 6 quizzes

Module 1: What machine learning is and how to prepare for it4 lessons

Understand the kinds of machine learning problems, set up scikit-learn, prepare data for a model and learn to split it honestly and set a baseline.

  1. What machine learning is and the main problem types 15 min
  2. Setting up scikit-learn and the machine learning workflow 14 min
  3. Features, labels and preparing data 18 min
  4. Train and test sets, and beating a baseline 15 min
  5. Quiz: 8 questions
Module 2: Predicting with simple models3 lessons

Fit straight-line and logistic models, understand how they work and use k-nearest neighbours with properly scaled data.

  1. Linear regression 18 min
  2. Logistic regression for classification 17 min
  3. k-nearest neighbours and feature scaling 17 min
  4. Quiz: 8 questions
Module 3: Trees, forests and clusters3 lessons

Learn decision trees, combine many trees into a random forest and group unlabelled data with k-means clustering.

  1. Decision trees 17 min
  2. Random forests and feature importance 17 min
  3. Clustering with k-means 16 min
  4. Quiz: 8 questions
Module 4: Evaluating models properly3 lessons

Measure classification and regression models with the right numbers, recognise overfitting and use cross-validation and tuning without cheating.

  1. Evaluating classifiers: accuracy, precision, recall and the confusion matrix 18 min
  2. Evaluating regression models and spotting overfitting 17 min
  3. Cross-validation, tuning and pipelines 18 min
  4. Quiz: 8 questions
Module 5: A full project, responsibility and deployment4 lessons

Put everything together in one project, learn where bias and harm come from and see how a trained model is saved, served and monitored.

  1. A complete scikit-learn project 20 min
  2. Bias, fairness and privacy in machine learning 17 min
  3. Saving a model and putting it to work 18 min
  4. Where to go next 14 min
  5. Quiz: 8 questions
Final exam

30 questions. Pass with 70% or more to earn your certificate.

What you need

  • Completion of Data Analysis with Python: pandas and Charts, or equivalent pandas and NumPy skills
  • A computer that can run Python and Jupyter, or a browser and a Google account for Google Colab
  • School-level maths: averages, graphs of straight lines and percentages

Further reading

To install on iPhone or iPad: tap the Share button in Safari, then choose "Add to Home Screen".