9
Introduction to Machine Learning Classification: Tasks compstat-lmu.github.io/lecture_i2ml

Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

  • Upload
    others

  • View
    30

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

Introduction to Machine Learning

Classification: Tasks

compstat-lmu.github.io/lecture_i2ml

Page 2: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

CLASSIFICATION

Learn functions that assign class labels to observation / feature vectors.Each observation belongs to exactly one class. The main difference toregression is the scale of the output / label.

SepalLength

SepalWidth

PetalLength

PetalWidth

Species

5.1 3.5 1.4 0.2 setosa

5.9 3.0 5.1 1.8 virginica

Classifier

SepalLength

SepalWidth

PetalLength

PetalWidth

Species

5.4 3.3 3.2 1.1 ???

New Data withunknown label

New Class label

Our Data

c© Introduction to Machine Learning – 1 / 8

Page 3: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

BINARY AND MULTICLASS TASKS

The task can contain 2 classes (binary) or multiple (multiclass).

●●

●●

●●

●●●

●●

●●

●●

● ●

● ●

●●

●●

●●● ●

●●

●●

●● ●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●●

●●

●●●

●●

●●

●●

● ●

●●

●●

●●

●●●

●●

●●

0.00

0.05

0.10

0.15

0.20

0.00 0.01 0.02 0.03 0.04 0.05V1

V2

Class

● M

R

Sonar

●●● ●●

●●

●●

●●

●●

● ●●

●●

●● ●●

●●●●

● ●

●●

●●●●

0.0

0.5

1.0

1.5

2.0

2.5

2 4 6Petal.Length

Pet

al.W

idth Species

● setosa

versicolor

virginica

Iris

c© Introduction to Machine Learning – 2 / 8

Page 4: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

BINARY CLASSIFICATION TASK - EXAMPLES

Credit risk prediction, based on personal data and transactions

Spam detection based on textual features

Churn prediction based on customer behavior

Predisposition for specific illness based on genetic data

c© Introduction to Machine Learning – 3 / 8

Page 5: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

BINARY CLASSIFICATION TASK - EXAMPLEShttps://www.bendbulletin.com/localstate/deschutescounty/3430324-151/fact-or-fiction-polygraphs-just-an-investigative-tool

c© Introduction to Machine Learning – 4 / 8

Page 6: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

MULTICLASS TASK - MEDICAL DIAGNOSIS

https://symptoms.webmd.com

c© Introduction to Machine Learning – 5 / 8

Page 7: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

MULTICLASS TASK - IRIS

The iris dataset was introduced by the statistician Ronald Fisher and isone of the most frequent used datasets. Originally it was designed forlinear discriminant analysis.

Setosa Versicolor Virginica

Source:https://en.wikipedia.org/wiki/Iris_flower_data_set

c© Introduction to Machine Learning – 6 / 8

Page 8: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

MULTICLASS TASK - IRIS

150 iris flowers

Predict subspecies

Based on sepal and petallength / width in [cm]

## Sepal.Length Sepal.Width Petal.Length Petal.Width Species

## 1: 5.1 3.5 1.4 0.2 setosa

## 2: 4.9 3.0 1.4 0.2 setosa

## 3: 4.7 3.2 1.3 0.2 setosa

## 4: 4.6 3.1 1.5 0.2 setosa

## 5: 5.0 3.6 1.4 0.2 setosa

## ---

## 146: 6.7 3.0 5.2 2.3 virginica

## 147: 6.3 2.5 5.0 1.9 virginica

## 148: 6.5 3.0 5.2 2.0 virginica

## 149: 6.2 3.4 5.4 2.3 virginica

## 150: 5.9 3.0 5.1 1.8 virginica

c© Introduction to Machine Learning – 7 / 8

Page 9: Introduction to Machine Learning...CLASSIFICATION Learn functions that assign class labels to observation / feature vectors. Each observation belongs to exactly one class. The main

MULTICLASS TASK - IRIS

●●

● ●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●●

● ●

●●

●● ●

●●

● ●

●●

● ●●

●●

●●

●●

●●●

●●

●● ●

●●

●●●● ●●

● ●● ● ●●●● ●

●●●●● ●●

●●●● ●●●● ●● ●●● ●●● ●●●●●●

● ●● ●●

●●●

●● ●

●●

●●

●●●

●●● ●

●●●

●●● ●

● ● ●●

●●● ●

●●● ●

●● ●

●●

●● ●●● ●●

●●

●●

●●

● ●●

●●

●●

●●

●●●●

●●●● ●●

●●●● ●●

●●●

●●●

●●●

●●● ●●

●●

● ●●

●●●●●

●●●● ●

●● ●

●●●

●●

●●● ●●

●● ●

●●

●●

●●

●●

●●

●●

● ●

●●

●●●

●●

●●

●●●●

●●

●●● ●

●●

●●

●●

●●●

●●

●●

●●

●●

● ●●

●●●

●●

●●

●●

●●

●●

●●●

●●

Cor : −0.118setosa: 0.743

versicolor: 0.526virginica: 0.457

●● ●● ●●

●●● ● ●●●● ●

●●●●●● ●

●●● ●●●●● ● ●●●

● ●●● ●●● ●●

●● ●● ●●

●●●

●● ●

●●

●●

●●●

● ●●●

● ●●

●●● ●

● ●●●

●●● ●

● ●●●

●●●

●●

●● ●● ● ●●

●●

●●

● ●

● ●●

●●

●●

●●

●●●●

●●●● ● ●●

●● ●● ●●

●●●

●●●

●●●

●●● ●●

●●

●●●

●●●●●

●●●● ●

●● ●

●●●

●●

●●● ●●

●●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

● ●●●

●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●

●●●

●● ●

●●

●●

●●

●●

●●

●●

●●

Cor : 0.872setosa: 0.267

versicolor: 0.754virginica: 0.864

Cor : −0.428setosa: 0.178

versicolor: 0.561virginica: 0.401

●●●●●●

●●●●●●

●●●

●●●●●

●●

●●●

●●●●●

●●●●●●

●●●●●

●●

●●●●●

●● ●

●●

●●

●●

●●

●●

●●● ●

●●

●●

●●

●●●

●●●●●

●●

●●●●

●●

●●

●●

●●●

●●

●●

●●

●●

● ●●

●●●

●●

●●

●●

●●

●●

●●

●●

Cor : 0.818setosa: 0.278

versicolor: 0.546virginica: 0.281

Cor : −0.366setosa: 0.233

versicolor: 0.664virginica: 0.538

Cor : 0.963setosa: 0.332

versicolor: 0.787virginica: 0.322

●●

●●

●●

Sepal.Length Sepal.Width Petal.Length Petal.Width Species

Sepal.Length

Sepal.W

idthP

etal.LengthP

etal.Width

Species

5 6 7 8 2.0 2.5 3.0 3.5 4.0 4.5 2 4 6 0.0 0.5 1.0 1.5 2.0 2.5 setosaversicolorvirginica

0.0

0.4

0.8

1.2

2.0

2.5

3.0

3.5

4.0

4.5

2

4

6

0.0

0.5

1.0

1.5

2.0

2.5

0.02.55.07.5

0.02.55.07.5

0.02.55.07.5

c© Introduction to Machine Learning – 8 / 8