Statistical Data Science
Awol Seid Ebrie
Division of Epidemiology and Biostatistics
School of Public Health, University of the Witwatersrand
Johannesburg, South Africa
Email: [Link]@[Link]
06 April 2026
About Me (1/2)
Awol Seid Ebrie
PhD in Industrial Data Science and Engineering
Pukyong National University and Pusan National University, Busan, South Korea
MSc in Biostatistics
Jimma University, Jimma, Ethiopia
BSc in Statistics
University of Gondar, Gondar, Ethiopia
2 / 38
About Me (2/2)
Postdoctoral Research Fellow in Biostatistics
The Application of AI and ML for Disease Prevention and Personalized Treatment
University of the Witwatersrand (Wits), Johannesburg, South Africa
Sub–Saharan Africa Consortium for Advanced Biostatistics (SSACAB)
Led by the Division of Epidemiology and Biostatistics, Wits University, South Africa
Around 7 African institutions
Two Northern Partners
• London School of Hygene and Tropical Medicine (LSHTM)
• University Medical Center Utrecht (UMC Utrecht)
3 / 38
Contents to be covered
Day I: Python Programming
Day II: Statistical Machine Learning for Regression and Classification Problems
Day III: Deep Neural Networks (aka Deep Learning) for Survival Data Analysis
Day IV: Advanced Deep Learning: CNNs for Image Classification
4 / 38
Recommended Resources
1. An Introduction to Statistical Learning: Book
2. Learning from Data: Book, Video Lecture
3. Foundations of Machine Learning: Course,Video Lecture
4. Dive into Deep Learning: Book
5 / 38
Software and Tools Required
• Python Distribution: Anaconda (with Jupyter Notebook) or Google Colab
• Anaconda:
• A Python distribution designed for data science and scientific computing.
• Includes Python, essential libraries, and tools in one installation.
• Jupyter Notebook
• An interactive coding environment widely used for learning and research.
• Allows writing code, executing it, and viewing results instantly.
• Google Colab
• A cloud-based version of Jupyter Notebook that runs in a web browser.
• Requires NO installation and enables running Python code online.
• Useful for accessing higher computing power and working across devices.
• Specific Libraries: scikit-learn, PyTorch, PyCox.
6 / 38
Outline
1. Review of Variables and Related Concepts
2. Artificial Intelligence
3. Classical Programming vs Machine (Statistical) Learning
4. Definition of Learning and its Types
7 / 38
Review of Variables and Related Concepts
Variables: Types, Roles
Variable is a characteristic or an attribute that can assume different values.
9 / 38
Common Statistical Methods
Dependent Independent Variable Method
Continuous Binary t test
Continuous Multinomial ANOVA
Continuous Continuous Correlation
Categorical Categorical Chi-square test
Continuous Quantitative/Categorical/Both Linear Regression
Binary Quantitative/Categorical/Both Binary Logistic Regression
Multinomial Quantitative/Categorical/Both Multinomial Logistic Regression
Ordinal Quantitative/Categorical/Both Ordinal Logistic Regression
Discrete Quantitative/Categorical/Both Poisson Regression Model
Time-to-event Quantitative/Categorical/Both Survival Regression Model
Note: There is NO need to identify the role of variables for correlation and chi-square test.
10 / 38
Big Data (1/2)
• Due to Internet of Events, data is being generated at any time and at any place.
• Incredible scale of data (Volume)
• High frequency data generation (Velocity)
• Different types of data from multiple sources (Variety)
• Trustworthiness of the data (Veracity)
• Big data is characterized by ”four V’s”: Volume, Velocity, Variety, and Veracity.
11 / 38
Big Data (2/2)
• Big data supports decision-making by answering key analytical questions:
• Descriptive / Reporting: What happened?
• Diagnosis: Why did it happen?
• Prediction: What will happen?
• Prescriptive / Recommendation: What is the best that can happen?
• Extracting meaningful insights from large volumes of data has been a major challenge.
• Advances in Artificial Intelligence (AI) now enable the efficient analysis of large-scale
data, transforming it into actionable insights and value.
12 / 38
Artificial Intelligence
Artificial Intelligence (AI) (1/2)
• Which of the following represents an AI system?
• Calculator
• Traffic light control
• Chatbots
• Self-driving car
14 / 38
Artificial Intelligence (AI) (2/2)
• AI is automated decision-making by machines (e.g., computers) using maths and stats.
• Calculator
• Traffic light control
• Chatbots
• Self-driving car
• AI is NOT magic, NOT consciousness, NOT a machine ”thinking” like a human.
• Its power is NOT ”intelligence in the human sense”, but speed, consistency, and scale.
15 / 38
AI vs Machine Learning (ML) vs Deep Learning (DL)
16 / 38
AI vs Machine Learning (ML) vs Deep Learning (DL)
Artificial Intelligence (AI)
• Systems with cognitive functions
• Intelligent machines (e.g., computers)
16 / 38
AI vs Machine Learning (ML) vs Deep Learning (DL)
Artificial Intelligence (AI)
• Systems with cognitive functions
• Intelligent machines (e.g., computers)
Machine Learning (ML)
• Input-output relationships
• Data distributions
• Dynamic environmental interactions
16 / 38
AI vs Machine Learning (ML) vs Deep Learning (DL)
Artificial Intelligence (AI)
• Systems with cognitive functions
• Intelligent machines (e.g., computers)
Machine Learning (ML)
• Input-output relationships
• Data distributions
• Dynamic environmental interactions
Deep Learning (DL)
• Neural networks with multiple layers
• Learn patterns from any form of data
16 / 38
Some Terms in ML
Statistics Machine Learning
Dependent Variable Output feature / Target / Label
Independent Variable Input feature (or simply Feature)
Observation Sample / Example
17 / 38
Classical Programming vs Machine (Statistical)
Learning
Classical Programming vs Machine (Statistical) Learning
• Rules are needed to be explicitly coded.
• To determine whether a number x is even:
• Divide the number by 2.
• Get the remainder.
• If the remainder is 0, x is even.
• The rule here is x%2 = 0.
• This logic should be hard-coded.
• Deterministic.
19 / 38
Classical Programming vs Machine (Statistical) Learning
• Rules are needed to be explicitly coded. • System learns the rules (model) by itself.
• To determine whether a number x is even: • Provided examples instead of a fixed rule.
• Divide the number by 2.
Input 2 4 1 3
• Get the remainder.
Output Even Even Odd Odd
• If the remainder is 0, x is even.
• We do not tell what even or odd means.
• The rule here is x%2 = 0.
• This logic should be hard-coded. • It figures out the rules from the data.
• Deterministic. • Probabilistic.
19 / 38
Definition of Learning and its Types
What is Learning?
Learning
Learning is finding empirical, data-driven solutions for problems with unknown or complex
relationships when no analytical solutions exist or mathematical formulations are intractable.
Three key aspects of learning:
• The existence of problem governed by unknown or highly complex rules.
• The inability to express the problem analytically or with explicit formulas.
• The availability of a large amount of data from which patterns can be learned.
21 / 38
Types of Learning
Supervised Learning (SL), Unsupervised Learning (UL) and Reinforcement Learning (RL).
22 / 38
Supervised Learning (SL)
• SL aims to map a d dimensional input space to an output space, f : X d → Y.
• The target f represents the true (but unknown) relationship between the inputs x and output y.
• The output space could also be q dimensional, f : X d → Y q.
• The target function f for a univariate model could be expressed as: y = f (x; θ ) + ε.
• y is the outcome, x = [x1 , x2 , · · · , xd ] represents the values of a set of d covariates.
• θ consists of all parameters, ε the error term.
Example Input Features Labels
1 x11 x12 ··· x1d y1
2 x21 x22 ··· x2d y2
.. .. .. .. .. ..
. . . . . .
N xN1 xN2 ··· xNd yN
• The term ’supervised’ refers to the fact that the target values provide a supervisory role.
23 / 38
Supervised Learning (SL): Generalized Linear Models (GLMs)
The target function for most statistical models is f (x; b, w) = b + w1 x1 + · · · + wd xd where
• b is the bias (or intercept)
• wj ’s are the weights associated with the covariates xj ’s
Three components of a GLM:
1. Random Component: It specifies the probability distribution of the response variable.
2. Systematic Component: It is often a linear predictor: z = b + w1 x1 + w2 x2 + · · · + wd xd .
3. Link Function: It specifies the link between the random and the systematic components.
Model Distribution Random Part Link Activation (Inverse Link)
Linear Gaussian µ = E(Y|x) = ŷ Identity Identity: z
Poisson Poisson µ = E(Y|x) = ŷ Log Exp: ez
Logistic Binomial π = E[P(Y = 1|x)] Log odds Sigmoid: 1+1e−z
24 / 38
Generalized Linear Models (GLMs)
• Linear regression: y ∈ R
ŷ = I(z) = b + w1 x1 + w2 x2 + · · · + wd xd , where I(.) is an identity function.
• Logistic regression: y ∈ {0, 1}, p = P̂(Y = 1|x), 0 ≤ p ≤ 1, {ŷ = 1 if p ≥ 0.5 else 0}
eb+w1 x1 +w2 x2 +···+wd xd
p = σ (z) =
1 + eb+w1 x1 +w2 x2 +···+wd xd
1
where σ (z) = is a sigmoid (or logistic) function.
1 + e−z
Note:
Functions like I(·), σ (·) in GLMs are called activations in machine (and deep) learning.
25 / 38
Supervised Learning (SL): Two Basic tasks
• Regression problem: predicts continuous (or quantitative) outcome.
• Regression line: ŷi = b + w1 xi1 + w2 xi2 + · · · + wd xid
• Examples: Tumor size estimation, predicting HIV viral load
• Classification problem: predicts categorical outcomes (or probability of categories).
• Decision boundary: b + w1 xi1 + w2 xi2 + · · · + wd xid = 0
• Examples: Patient outcome (death or not), TB detection from radiological image.
26 / 38
Supervised Learning (SL): Regression Problems
1. Predicting SBP based on age, BMI, and cholesterol.
2. Predicting the number of asthma attacks a patient will have in a year.
3. Predicting the proportion of body fat (%) relative to total weight.
4. Predicting medication adherence rate (e.g., a patient takes 80% of prescribed pills).
5. Predicting time until relapse after chemotherapy.
6. Predicting time to hospital readmission for heart failure patients.
27 / 38
Supervised Learning (SL): Classification Problems
• Binary Classification: The model predicts between two mutually exclusive outcomes.
• Predicting whether a patient has diabetes: Yes / No
• Classifying chest X-rays as Pneumonia / Normal
• Multi-Class Classification: The model predicts one label from 3+ possible classes.
• Predicting type of cancer: Breast / Lung / Colon / Prostate
• Stroke severity scale: Mild / Moderate / Severe
• Multi-Label Classification: The model predicts several conditions simultaneously.
• Predicting comorbidities: Diabetes / Hypertension / Heart Failure / CKD
• Symptom checker: Fever / Cough / Fatigue / Shortness of Breath
28 / 38
Some Machine Learning and Statistical Terms
Machine Learning Statistics
Output feature / Target / Label Dependent Variable
Input feature (or simply Feature) Independent Variable
Sample / Example Observation
Model Training Model Fitting
Bias Parameter Intercept Parameter
Weight Parameter Slope Parameter
Learning Estimating Parameters
Number of output features Number of outcome variables
(or Number of classes of a multinomial outcome)
29 / 38
Unsupervised Learning (UL)
• UL identifies hidden patterns, structures, or groupings among observations or variables
in a dataset D = {x1 , x2 , · · · , xN }, without access to corresponding output labels.
Example Features
1 x11 x12 ··· x1p
2 x21 x22 ··· x2p
.. .. .. .. ..
. . . . .
N xN1 xN2 ··· xNp
30 / 38
Unsupervised Learning (UL): Applications - (1/2)
• Dimensionality Reduction:
• Reduce number of features, preserving important structure.
• Reduce thousands of gene expression features to a few informative components.
• Association Rule Mining:
• Discover rules or patterns (often in market basket analysis)
• Discovering comorbidity patterns: e.g., patients with diabetes often also have hypertension.
• Finding patterns in medication prescriptions: which drugs are often prescribed together.
• Identifying diet patterns associated with certain health outcomes.
31 / 38
Unsupervised Learning (UL): Applications - (2/2)
• Clustering:
• Segment observations into similar groups.
• Group patients based on lab results, vitals, and demographics to discover clinical subgroups
• Anomaly (Outlier) Detection:
• Identify rare or unusual observations
• Identify unexpected adverse reactions in post-market drug surveillance data.
• Detect abnormal spikes or drops in heart rate or blood pressure in ICU data.
32 / 38
Clustering vs Classification
33 / 38
Reinforcement Learning (RL)
• In RL, an agent learns through trial and error, based on a sequence of interactions within
a certain dynamic environment: {(st , at , rt , st+1 )}Tt=1 .
• In state st , the agent takes an action at , receives a reward rt and proceed to next state st+1 .
• The aim is to learn a policy π : S → A that maximizes its expected cumulative reward.
34 / 38
Reinforcement Learning (RL)
• In RL, an agent learns through trial and error, based on a sequence of interactions within
a certain dynamic environment: {(st , at , rt , st+1 )}Tt=1 .
• In state st , the agent takes an action at , receives a reward rt and proceed to next state st+1 .
• The aim is to learn a policy π : S → A that maximizes its expected cumulative reward.
Time Step State st Action at Reward rt Next State st+1
t=1 s1 a1 r1 s2
t=2 s2 a2 r2 s3
.. .. .. .. ..
. . . . .
t=T sT aT rT sT + 1
34 / 38
Examples
For each of the following tasks, identify which type of learning is involved. If a task can fit
more than one type, explain how?
1. Recommending a medical book to a user in an online bookstore.
2. Categorizing movies into different types
3. Learning to play music
35 / 38
Solutions
1. Supervised learning: The properties of books and the user’s interests.
2. Supervised or unsupervised learning:
• Supervised learning: The properties of movies and the labels of different types.
• Unsupervised learning: No need to get the labels of different types.
3. Unsupervised, supervised, or reinforcement learning:
• Unsupervised learning: Learning from a teacher.
• Supervised learning: Learning by yourself.
• Learning by yourself but another person tells you whether your music is good or not.
36 / 38
Thank You!