07-Classification
07-Classification
Classification
• Overview
• Classification Models
• Summary
This is a whale
This is a bear
Class of object 1
Object 1
Concept
Object 2
Class of object 2
• Object space
• Set of classes
• Classification
• Finding an approximation of the target concept
Oval body
• Example
• Three classes: „whale“, „bear“, „other“
score whale
score bear score other
• Standard approach:
• Classification is class with highest score
… … … … … …
Actual class
whale 29 1 3
bear 2 22 13
other 4 11 51
true false
• F1 measure
• Harmonic mean of precision and recall
• Plot of true positive rate (TPR) versus false positive rate (FPR)
• Overview
• Classification Models
• Summary
• Basic Idea
• Instances with similar feature values should have the same class
• Class can be determined by looking at instances that are similar
• Basic Idea
• Make decisions based on logical rules about features
• Organize rules as a tree
• Recursive algorithm
• Stop if
• Data is “pure”, i.e. mostly from class
• Amount of data is too small, i.e., only few instances in partition
• Otherwise
• Determine „most informative feature“
• Partition training data using
• Recursively create subtree for each partition
Overfitting
• Basic Idea:
• Regression model of the probability that an object belongs to a class
• Combines the function with linear regression
• Linear Regression
• as linear combination of
• The function
• Logistic Regression
Definition
• It follows that is the odds ratio of feature
of odds
• Odds ratio means the change in odds if we increase by one.
• Odds ratio greater than one means increased odds
• Odds ratio less than one mean decreased odds
• Basic idea:
• Assume all features as independent
• Score classes using the conditional probability
• Bayes Law
• Multinomial
• is the empirical probability of observing a feature
• “Counts” observations of in the data
• Gaussian
• Assumes features follow a gaussian/normal distribution
• Estimates conditional probability using the gaussian density function
• Basic Idea:
• Calculate decision boundary such that it is “far away” from data
Linear decision
boundary Support vectors
= Instances with minimal
distance to decision
bounday
Margin is
Margin
maximized
• Basic Idea:
• Network of neurons with different layers and communication between
neurons
• Input layer feeds data into the network
• Hidden layers “correlate” data
• Output layer gives computation results
Input Output
Layer Layer
Two hidden
layers
Introduction to Data Science
https://sherbold.github.io/intro-to-data-science
Multilayer Perceptron (MLP)
Multiple fully
connected
hidden layers
• Overview
• Classification Models
• Summary
Times taken using GWDG Jupyter Hub and scikit-learn implementations of the algorithms.
Data randomly generated with using scikit-learn.datasets.make_moons (July 2018)
• Overview
• Classification Models
• Summary