Data and ML algorithms
Machine Learning with PyTorch and Scikit-Learn
Sebastian Raschka, Yuxi (Hayden) Liu, Vahid Mirjalili
NoSQL
(mongoDB)
spreadsheetscsv files
relational databases
ML
small amount of data
big amount of data
Big Data
Me: “Could you give a definition of ML in 15 words?”
ChatGPT: “A field of study enabling computers to learn from data and make predictions autonomously”
Me: “What ML does (in 20 words)?”
ChatGPT: “ML analyzes data patterns to make predictions, automate tasks, improve decision-making, and enable systems to learn without explicit programming"
The three different types of (traditional) ML
Supervised learning
Unsupervised learning
Reinforcement learning
Supervised learning
Unsupervised learning
Reinforcement learning
The three different types of (traditional) ML
> Labelled data
> Direct feedback
> Predict
outcome/future
Supervised learning
Unsupervised learning
Reinforcement learning
The three different types of (traditional) ML
> Email spam filtering
> Protein secondary
structure prediction
> Free energy of
folding after mutating
a residue in a protein
Supervised
Unsupervised
Reinforcement
The three different types of (traditional) ML
Classification for predicting class labels
Classifying a new data point
id | gender | age | heigh (cm) | weight (kg) | Max blood pressure (mmHg) | responsiveness to treatment (label) |
1 | F | 27 | 174 | 61 | 128 | yes |
2 | F | 32 | 169 | 58 | 123 | yes |
3 | M | 26 | 177 | 68 | 158 | no |
4 | M | 38 | 184 | 88 | 118 | yes |
5 | F | 77 | 162 | 51 | 148 | no |
… | … | … | … | … | … | … |
Supervised
Unsupervised
Reinforcement
The three different types of (traditional) ML
Regression for predicting continuous outcomes
Predicting the target variable of new data
Example of linear regression
Supervised learning - label learning
Supervised learning
Unsupervised learning
Reinforcement learning
> Labelled data
> Direct feedback
> Predict
outcome/future
The three different types of (traditional) ML
> No labels/targets
> No feedback
> Find hidden
structure in data
Unsupervised learning – Clustering
Sample ID | Gene A | Gene B | Gene C | Gene D | Gene E | Tissue Type (Hidden) |
1 | 8.2 | 3.1 | 5.5 | 7.8 | 6.0 | Brain |
2 | 2.3 | 9.0 | 1.2 | 4.5 | 7.5 | Liver |
3 | 6.5 | 2.9 | 8.3 | 3.4 | 5.1 | Brain |
4 | 1.1 | 8.5 | 2.7 | 5.6 | 9.2 | Liver |
5 | 7.8 | 3.4 | 6.1 | 8.9 | 4.3 | Brain |
6 | 3.0 | 7.9 | 2.0 | 4.2 | 8.7 | Liver |
7 | 9.5 | 2.0 | 7.1 | 5.7 | 3.8 | Brain |
8 | 4.2 | 8.8 | 1.5 | 6.9 | 7.3 | Liver |
Example Dataset: Gene Expression in Tissue Samples
Supervised learning
Unsupervised learning
Reinforcement learning
> Labelled data
> Predict outcome
> Direct feedback
The three different types of (traditional) ML
> No labels/targets
> Make sense in data
> No feedback
Unsupervised learning - Dimensionality reduction
Supervised learning
Unsupervised learning
Reinforcement learning
> Labelled data
> Direct feedback
> Predict
outcome/future
The three different types of (traditional) ML
> No labels/targets
> No feedback
> Find hidden
structure in data
> Decision process
> Reward system
> Learn series of
actions
Reinforcement learning
The Reinforcement learning loop
1. Agent observes the current state of the environment
2. Agent selects an action according to its current policy
3. Environment transitions to a new state
4. Agent receives a reward signal
5. Agent updates its policy based on the reward → repeat
Reinforcement learning
Trainer
+ room
Situation
Dog
Cookie
Reinforcement learning
Chess board
Current configuration
Computer
Good or bad move
Reinforcement learning: 8 examples
Supervised learning
Unsupervised learning
Reinforcement learning
> Labelled data
> Direct feedback
> Predict
outcome/future
The three different types of (traditional) ML
> No labels/targets
> No feedback
> Find hidden
structure in data
> Decision process
> Reward system
> Learn series of
actions