Classification
1
Classification vs. Prediction
◼ Classification
◼ Predicts categorical class labels (discrete or nominal)
◼ Classifies data (constructs a model) based on the training set
and the values (class labels) in a classifying attribute and
uses it in classifying new data.
◼ For example, we can build a classification model to
categorize bank loan applications as either safe or risky.
◼ Prediction
◼ models continuous-valued functions, i.e., predicts unknown
or missing values
◼ Typical applications
◼ Credit approval
◼ Target marketing
2
Classification—A Two-Step Process
◼ Data classification is a two-step process:
◼ Learning step (where a classification model is constructed)
◼ Classification step (where the model is used to predict class
labels for given data).
◼ In the learning step (or training phase), a classification algorithm
builds the classifier by analyzing or “learning from” a training set.
◼ A tuple, X, is represented by an N-dimensional attribute vector,
X ={x1, x2,……..xN}
◼ Each tuple, X, is assumed to belong to a predefined class as
determined by another database attribute called the class label
attribute.
◼ The individual tuples making up the training set are referred to as
training tuples and are randomly sampled from the database under
analysis.
3
Learning
4
Classification
5
Process (1): Model Construction
Classification
Algorithms
Training
Data
NAME RANK YEARS TENURED Classifier
M ike A ssistant P rof 3 no (Model)
M ary A ssistant P rof 7 yes
B ill P rofessor 2 yes
Jim A ssociate P rof 7 yes
IF rank = ‘professor’
D ave A ssistant P rof 6 no
OR years > 6
A nne A ssociate P rof 3 no
THEN tenured = ‘yes’
6
Process (2): Using the Model in Prediction
Classifier
Testing
Data Unseen Data
(Jeff, Professor, 4)
NAME RANK YEARS TENURED
Tom Assistant Prof 2 no Tenured?
Merlisa Associate Prof 6 no
George Professor 5 yes
Joseph Assistant Prof 7 yes
7
Supervised vs. Unsupervised Learning
◼ Supervised learning (classification)
◼ Supervision: The training data (observations,
measurements, etc.) are accompanied by labels indicating
the class of the observations
◼ New data is classified based on the training set
◼ Unsupervised learning (clustering)
◼ The class labels of training data is unknown
◼ In this we can predict the class labels by using clustering
technique.