1.
3
A Typical Machine Learning Work ow
Sebastian Raschka and the Lightning AI Team
fl
An Example of A Classification Task
Is this email spam or not?
https://computing.which.co.uk/hc/en-gb/articles/115002560545-Common-email-mistakes-that-lead-to-spam
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
2
Classification
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
3
Supervised Learning
Example Example Example
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
4
Supervised Learning
https://www.wildfooduk.com/mushroom-guides/destroying-angel-mushroom/
https://cdn.britannica.com/79/145379-050-4461FF66/Death-cap-mushroom.jpg https://www.chop.edu/sites/default/ les/styles/16_9_small/public/poisonous-mushroom-16x9.jpg?itok=lRw33d9-
Example Example Example
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
5
fi
Supervised Learning
Label: poisonous Label: poisonous Label: edible
https://www.wildfooduk.com/mushroom-guides/destroying-angel-mushroom/
https://cdn.britannica.com/79/145379-050-4461FF66/Death-cap-mushroom.jpg https://www.chop.edu/sites/default/ les/styles/16_9_small/public/poisonous-mushroom-16x9.jpg?itok=lRw33d9-
Example Example Example
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
6
fi
Supervised Learning Workflow
Training dataset
Examples
Labels
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
7
Supervised Learning Workflow
Training dataset
Model &
Examples learning algorithm
Labels
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
8
Supervised Learning Workflow
Training dataset
Model & Trained model
Examples learning algorithm
Labels
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
9
Supervised Learning Workflow
Training
Training dataset
Model &
Examples Trained model
learning algorithm
Labels
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
10
Supervised Learning Workflow
New observations
Training
Training dataset
Model &
Examples Trained model
learning algorithm
Labels
Predicted labels
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
11
Supervised Learning Workflow
Inference
New observations
Training
Training dataset
Model & Trained model
Examples
learning algorithm
Labels
Predicted labels
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
12
Common Types of Supervised Learning
1) Classi cation
Predicting a class label
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
13
fi
Common Types of Supervised Learning
1) Classi cation
Predicting a class label
Which
animal is
this?
https://static01.nyt.com/images/2021/09/14/science/07CAT-STRIPES/07CAT- https://imageio.forbes.com/specials-images/imageserve/5db4c7b464b49a0007e9dfac/Photo-of-
https://en.wiktionary.org/wiki/cat#/media/File:Cat03.jpg STRIPES-jumbo.jpg?quality=75&auto=webp Maltese-dog/960x0.jpg? t=bounds&format=jpg&width=960
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
14
fi
fi
Common Types of Supervised Learning
1) Classi cation
Predicting a class label
Which
animal is
this?
https://static01.nyt.com/images/2021/09/14/science/07CAT-STRIPES/07CAT- https://imageio.forbes.com/specials-images/imageserve/5db4c7b464b49a0007e9dfac/Photo-of-
https://en.wiktionary.org/wiki/cat#/media/File:Cat03.jpg STRIPES-jumbo.jpg?quality=75&auto=webp Maltese-dog/960x0.jpg? t=bounds&format=jpg&width=960
Cat Cat Dog
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
15
fi
fi
Common Types of Supervised Learning
2) Regression
Predicting a continuous value
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
16
Common Types of Supervised Learning
2) Regression
Predicting a continuous value
How
expensive is
this?
https://photos.zillowstatic.com/fp/ https://www.zillow.com/homedetails/4530-W-Manitoba-St- https://photos.zillowstatic.com/fp/
efe9a1aa53ad401ca70e45e82fa933d3-cc_ft_384.webp Milwaukee-WI-53219/40496249_zpid/ 2b7864ad2767f21808409da4d152d876-cc_ft_768.webp
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
17
Common Types of Supervised Learning
2) Regression
Predicting a continuous value
How
expensive is
this?
https://photos.zillowstatic.com/fp/ https://www.zillow.com/homedetails/4530-W-Manitoba-St- https://photos.zillowstatic.com/fp/
efe9a1aa53ad401ca70e45e82fa933d3-cc_ft_384.webp Milwaukee-WI-53219/40496249_zpid/ 2b7864ad2767f21808409da4d152d876-cc_ft_768.webp
Sebastian Raschka $399,500 $189,900 Unit 1 $235,400
Deep Learning Fundamentals, Lightning AI
18
Supervised Learning Dataset
Input:
https://en.wikipedia.org/wiki/Iris_setosa#/media/File:Irissetosa1.jpg
Label:
Sebastian Raschka Deep Learning Fundamentals, Unit 1
Iris-setosa Lightning AI
19
Supervised Learning Dataset
Unstructured data
Input:
https://en.wikipedia.org/wiki/Iris_setosa#/media/File:Irissetosa1.jpg
Label:
Sebastian Raschka Deep Learning Fundamentals, Unit 1
Iris-setosa Lightning AI
20
Supervised Learning Dataset
Structured data
Unstructured data Inputs: Labels:
Sepal length Sepal width Petal length Petal length Label
5.1 3.5 1.4 0.3 Iris-setosa
4.9 3 1.4 0.2 Iris-setosa
5.9 3 5.1 1.8 Iris-virginica
… … … … …
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
21
Supervised Learning Dataset
Unstructured data Structured data
Sepal length Sepal width Petal length Petal length
5.1 3.5 1.4 0.3
Sepal 4.9 3 1.4 0.2
5.9 3 5.1 1.8
… … … …
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
22
Supervised Learning Dataset
Unstructured data Structured data
Petal
Sepal length Sepal width Petal length Petal length
5.1 3.5 1.4 0.3
Sepal 4.9 3 1.4 0.2
5.9 3 5.1 1.8
… … … …
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
23
Supervised Learning Dataset
“Manual” feature engineering
Petal
Sepal length Sepal width Petal length Petal length
Sepal 5.1 3.5 1.4 0.3
4.9 3 1.4 0.2
5.9 3 5.1 1.8
… … … …
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
24
Supervised Learning Dataset
Deep learning “Traditional” machine learning
Sepal length Sepal width Petal length Petal length
5.1 3.5 1.4 0.3
4.9 3 1.4 0.2
5.9 3 5.1 1.8
… … … …
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
25
Let’s explore how
machine learning classi ers
work!
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
26
fi