1 of 27

Data and ML algorithms

2 of 27

Machine Learning with PyTorch and Scikit-Learn

Sebastian Raschka, Yuxi (Hayden) Liu, Vahid Mirjalili

3 of 27

NoSQL

(mongoDB)

spreadsheetscsv files

relational databases

ML

small amount of data

big amount of data

Big Data

4 of 27

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"

5 of 27

The three different types of (traditional) ML

Supervised learning

Unsupervised learning

Reinforcement learning

6 of 27

Supervised learning

Unsupervised learning

Reinforcement learning

The three different types of (traditional) ML

> Labelled data

> Direct feedback

> Predict

outcome/future

7 of 27

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

8 of 27

Supervised

Unsupervised

Reinforcement

The three different types of (traditional) ML

Classification for predicting class labels

9 of 27

Classifying a new data point

10 of 27

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

11 of 27

12 of 27

Supervised

Unsupervised

Reinforcement

The three different types of (traditional) ML

Regression for predicting continuous outcomes

13 of 27

Predicting the target variable of new data

Example of linear regression

14 of 27

15 of 27

Supervised learning - label learning

16 of 27

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

17 of 27

Unsupervised learning – Clustering

18 of 27

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

19 of 27

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

20 of 27

Unsupervised learning - Dimensionality reduction

21 of 27

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

22 of 27

Reinforcement learning

23 of 27

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

24 of 27

Reinforcement learning

Trainer

+ room

Situation

Dog

Cookie

25 of 27

Reinforcement learning

Chess board

Current configuration

Computer

Good or bad move

26 of 27

Reinforcement learning: 8 examples

  1. Automated robots
  2. Natural language processing
  3. Marketing and Advertising
  4. Recommendation systems
  5. Gaming
  6. Energy conservation
  7. Traffic control
  8. Healthcare

27 of 27

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