RAIN
Cover of AIML 112 Machine Learning I

AIML 112

Machine Learning I

Supervised Learning: Theory, Algorithms and Practice

A lender in Kano must decide which loan applications to approve. A telecom operator wants to know which subscribers are about to leave. A family in Ibadan wants to know whether the rent they are being asked for is fair. Each of these is a prediction from data, and each can be made well or badly. Machine learning is the discipline of building such predictions from examples, measuring how good they are, and understanding when they can be trusted. This book teaches its core: supervised learning, in which a model learns to predict a known outcome from labelled examples.

14 chapters in 4 parts, 291 pages. Editor-in-Chief: Olusola Sayeed Ayoola. Published by RAIN, Ibadan, 2026.

Contents

Open a chapter to see its sections. Each chapter ends with a QR code for its free assessment.

1What Machine Learning Is
  • 1.1 Learning from data
  • 1.2 Kinds of machine learning
  • 1.3 The machine-learning workflow
  • 1.4 Tools
  • 1.5 Case studies from Nigeria

Take the Chapter 1 assessment

2Mathematics for Machine Learning
  • 2.1 Vectors, matrices, norms and inner products
  • 2.2 Matrix calculus
  • 2.3 Convexity and why it matters
  • 2.4 Probability, likelihood and maximum likelihood
  • 2.5 Worked derivations used later in the book

Take the Chapter 2 assessment

3Optimisation
  • 3.1 Loss functions and empirical risk minimisation
  • 3.2 Gradient descent
  • 3.3 Batch, mini-batch and stochastic gradient descent
  • 3.4 Momentum and adaptive methods
  • 3.5 Implementing gradient descent in NumPy

Take the Chapter 3 assessment

4Linear Regression
  • 4.1 The model and its assumptions
  • 4.2 Ordinary least squares
  • 4.3 The gradient-descent solution
  • 4.4 Polynomial features and basis functions
  • 4.5 Evaluating regression models
  • 4.6 Worked example: predicting house rent in Ibadan

Take the Chapter 4 assessment

5Regularisation and the Bias-Variance Trade-off
  • 5.1 Overfitting and underfitting
  • 5.2 The bias-variance decomposition
  • 5.3 Ridge regression
  • 5.4 The lasso and the elastic net
  • 5.5 Using penalties correctly
  • 5.6 Choosing the penalty by cross-validation

Take the Chapter 5 assessment

6Logistic Regression
  • 6.1 The sigmoid and the log-odds
  • 6.2 Cross-entropy loss from maximum likelihood
  • 6.3 Training: gradient descent and Newton's method
  • 6.4 Multiclass classification
  • 6.5 Decision boundaries
  • 6.6 Logistic regression in practice

Take the Chapter 6 assessment

7Evaluating Classifiers
  • 7.1 The confusion matrix and its metrics
  • 7.2 Choosing a threshold
  • 7.3 ROC and precision-recall curves
  • 7.4 Class imbalance
  • 7.5 Calibration
  • 7.6 Case study: evaluating the loan model

Take the Chapter 7 assessment

8k-Nearest Neighbours and Naive Bayes
  • 8.1 Distance metrics and the curse of dimensionality
  • 8.2 The k-nearest-neighbour algorithm
  • 8.3 Bayes' theorem as a classifier
  • 8.4 Gaussian, multinomial and Bernoulli naive Bayes
  • 8.5 Worked example: spam filtering

Take the Chapter 8 assessment

9Decision Trees
  • 9.1 Recursive partitioning
  • 9.2 Impurity measures
  • 9.3 Regression trees
  • 9.4 Pruning and depth control
  • 9.5 Decision trees in practice

Take the Chapter 9 assessment

10Ensemble Methods
  • 10.1 Bagging and random forests
  • 10.2 Boosting
  • 10.3 XGBoost and LightGBM in practice
  • 10.4 Feature importance and its pitfalls
  • 10.5 Case study: ensembles for loan default

Take the Chapter 10 assessment

11Support Vector Machines
  • 11.1 The maximum-margin classifier
  • 11.2 The dual problem and support vectors
  • 11.3 Soft margins and the C parameter
  • 11.4 Kernels and the kernel trick
  • 11.5 Support vector regression

Take the Chapter 11 assessment

12Data Preparation for Modelling
  • 12.1 Splitting the data
  • 12.2 Transforming features
  • 12.3 Feature selection
  • 12.4 Avoiding data leakage

Take the Chapter 12 assessment

13Model Selection and Tuning
  • 13.1 k-fold cross-validation
  • 13.2 Hyperparameter search
  • 13.3 Learning curves and validation curves
  • 13.4 Reporting results honestly

Take the Chapter 13 assessment

14End-to-End Supervised Learning Project
  • 14.1 Problem framing and baseline
  • 14.2 Iteration and error analysis
  • 14.3 Packaging a model for deployment
  • 14.4 Model cards and documentation
  • 14.5 The course project

Take the Chapter 14 assessment

Order a copy

Printed copies are delivered anywhere in Nigeria or collected at RAIN in Ibadan; digital copies arrive by e-mail with your book owner code. We will reply with the price, delivery cost and payment details.

Schools and companies ordering several copies: put the number you need and we will quote.

Other RAIN textbooks

AIML 101 Building and Deploying AI ApplicationsAIML 111 Data Science with PythonAIML 211 Machine Learning IIAIML 212 Deep LearningRDA 111 Product Design and DevelopmentRDA 112 Practical Electronics

All the books