Prediction---accuracy
Prediction---accuracy
y = w 0 + w1 x
where w0 (y-intercept) and w1 (slope) are regression coefficients
( x x )( y y )
i i w y w x
w i 1
0 1
1 (x x) | D|
i
2
i 1
C1 C2
C1 True positive False
negative
C2 False True negative
positive
• Alternative accuracy measures
• Sensitivity or Recall (completeness) is also referred to as the true positive
(recognition) rate (that is, the proportion of positive tuples that are correctly
identified).
• specificity is the true negative rate (that is, the proportion of negative tuples
that are correctly identified).
• These measures are given as
sensitivity or Recall (completeness) = t-pos/pos /* true positive
recognition rate */
specificity = t-neg/neg /* true negative recognition rate */
precision (exactness )= t-pos/(t-pos + f-pos)
accuracy = sensitivity * pos/(pos + neg) + specificity * neg/(pos + neg)
– This model can also be used for cost-benefit analysis
• Sensitivity of the classifier is 90/ 300=30.00%.
• The specificity is 9560/ 9700= 98.56%.
• The classifier’s overall
accuracy is 9650/ 10,000 = 96.50%.
• The precision of the classifier for the yes class is
90/230 = 39.13%.
• The recall is 90 /300 = 30.00%
Predictor Error Measures
• Measure predictor accuracy: measure how far off the predicted value is from the actual
known value
• Loss function: measures the error betw. yi and the predicted value yi’
– Absolute error: | yi – yi’|
– Squared error: (yi – yi’)2
• Test error (generalization error):
d the average loss over the test set d
| y i y| (y
i 1
i y)2
i 1
• What is classification?
Support Vector MachinesWhat is prediction?
(SVM)
• Issues regarding
Associative classification and prediction
classification
• Classification
Lazy learners by
(ordecision
learningtree
frominduction
your neighbors)
• Bayesian classification
Other classification methods
• Rule-based
Prediction classification
• Classification
Accuracy andby back
error propagation
measures
• Ensemble methods
• Model selection
• Summary
January 30, 2025 Data Mining: Concepts and Techniqu 24
es
Ensemble Methods: Increasing the Accuracy
• Ensemble methods
– Use a combination of models to increase accuracy
– Combine a series of k learned models, M1, M2, …, Mk, with
the aim of creating an improved model M*
• Popular ensemble methods
– Bagging: averaging the prediction over a collection of
classifiers
– Boosting: weighted vote with a collection of classifiers
– Ensemble: combining a set of heterogeneous classifiers
January 30, 2025 Data Mining: Concepts and Techniqu 25
es
Bagging: Boostrap Aggregation
• Analogy: Diagnosis based on multiple doctors’ majority vote
• Training
– Given a set D of d tuples, at each iteration i, a training set Di of d tuples is
sampled with replacement from D (i.e., boostrap)
– A classifier model Mi is learned for each training set Di
• Classification: classify an unknown sample X
– Each classifier Mi returns its class prediction
– The bagged classifier M* counts the votes and assigns the class with the
most votes to X
• Prediction: can be applied to the prediction of continuous values by taking
the average value of each prediction for a given test tuple
• Accuracy
– Often significant better than a single classifier derived from D
– For noise data: not considerably worse, more robust
– 30,Proved
January 2025 improved accuracy in prediction
Data Mining: Concepts and Techniqu 26
es
Boosting
• Analogy: Consult several doctors, based on a combination of weighted
diagnoses—weight assigned based on the previous diagnosis accuracy
• How boosting works?
– Weights are assigned to each training tuple
– A series of k classifiers is iteratively learned
– After a classifier Mi is learned, the weights are updated to allow the
subsequent classifier, Mi+1, to pay more attention to the training tuples
that were misclassified by Mi
– The final M* combines the votes of each individual classifier, where the
weight of each classifier's vote is a function of its accuracy
• The boosting algorithm can be extended for the prediction of continuous
values
• Comparing with bagging: boosting tends to achieve greater accuracy, but it
also risks overfitting the model to misclassified data
January 30, 2025 Data Mining: Concepts and Techniqu 27
es
Adaboost (Freund and Schapire, 1997)
• Given a set of d class-labeled tuples,
• Initially, all the weights of tuples are set the same (1/d)
• Generate k classifiers in k rounds. At round i,
– Tuples from D are sampled (with replacement) to form a training set Di
of the same size
– Each tuple’s chance of being selected is based on its weight
– A classification model Mi is derived from Di
– Its error rate is calculated using Di as a test set
– If a tuple is misclssified, its weight is increased, o.w. it is decreased
• Error rate: err(Xj) is the misclassification error of tuple Xj. Classifier Mi error
rate is the sum of the weights of the misclassified tuples:
d
error ( M i ) w j err ( X j )
j
• The weight of classifier Mi’s vote is 1 error ( M i )
log
error ( M i )
January 30, 2025 Data Mining: Concepts and Techniques 28
the closer the ROC curve of a model
is to the diagonal line, the less accurate the model
Chapter 6. Classification and Prediction
• What is classification?
Support Vector MachinesWhat is prediction?
(SVM)
• Issues regarding
Associative classification and prediction
classification
• Classification
Lazy learners by
(ordecision
learningtree
frominduction
your neighbors)
• Bayesian classification
Other classification methods
• Rule-based
Prediction classification
• Classification
Accuracy andby back
error propagation
measures
• Ensemble methods
• Model selection
• Summary
January 30, 2025 Data Mining: Concepts and Techniqu 30
es
Model Selection: ROC Curves
• What is classification?
Support Vector MachinesWhat is prediction?
(SVM)
• Issues regarding
Associative classification and prediction
classification
• Classification
Lazy learners by
(ordecision
learningtree
frominduction
your neighbors)
• Bayesian classification
Other classification methods
• Rule-based
Prediction classification
• Classification
Accuracy andby back
error propagation
measures
• Ensemble methods
• Model selection
• Summary
January 30, 2025 Data Mining: Concepts and Techniqu 32
es
Summary (I)
• Classification and prediction are two forms of data analysis that can be used
to extract models describing important data classes or to predict future
data trends.
• Effective and scalable methods have been developed for decision trees
induction, Naive Bayesian classification, Bayesian belief network, rule-based
classifier, Backpropagation, Support Vector Machine (SVM), associative
classification, nearest neighbor classifiers, and case-based reasoning, and
other classification methods such as genetic algorithms, rough set and fuzzy
set approaches.
• Linear, nonlinear, and generalized linear models of regression can be used
for prediction. Many nonlinear problems can be converted to linear
problems by performing transformations on the predictor variables.
Regression trees and model trees are also used for prediction.
January 30, 2025 Data Mining: Concepts and Techniqu 33
es
Summary (II)
• Stratified k-fold cross-validation is a recommended method for accuracy
estimation. Bagging and boosting can be used to increase overall accuracy by
learning and combining a series of individual models.
• Significance tests and ROC curves are useful for model selection
• There have been numerous comparisons of the different classification and
prediction methods, and the matter remains a research topic
• No single method has been found to be superior over all others for all data
sets
• Issues such as accuracy, training time, robustness, interpretability, and
scalability must be considered and can involve trade-offs, further
complicating the quest for an overall superior method
• T.-S. Lim, W.-Y. Loh, and Y.-S. Shih. A comparison of prediction accuracy, complexity, and training
time of thirty-three old and new classification algorithms. Machine Learning, 2000.
• J. Magidson. The Chaid approach to segmentation modeling: Chi-squared automatic
interaction detection. In R. P. Bagozzi, editor, Advanced Methods of Marketing Research,
Blackwell Business, 1994.
• M. Mehta, R. Agrawal, and J. Rissanen. SLIQ : A fast scalable classifier for data mining. EDBT'96.
• T. M. Mitchell. Machine Learning. McGraw Hill, 1997.
• S. K. Murthy, Automatic Construction of Decision Trees from Data: A Multi-Disciplinary Survey,
Data Mining and Knowledge Discovery 2(4): 345-389, 1998
• J. R. Quinlan. Induction of decision trees. Machine Learning, 1:81-106, 1986.
• J. R. Quinlan and R. M. Cameron-Jones. FOIL: A midterm report. ECML’93.
• J. R. Quinlan. C4.5: Programs for Machine Learning. Morgan Kaufmann, 1993.
• J. R. Quinlan. Bagging, boosting, and c4.5. AAAI'96.
• R. Rastogi and K. Shim. Public: A decision tree classifier that integrates building and pruning.
VLDB’98.
• J. Shafer, R. Agrawal, and M. Mehta. SPRINT : A scalable parallel classifier for data mining.
VLDB’96.
• J. W. Shavlik and T. G. Dietterich. Readings in Machine Learning. Morgan Kaufmann, 1990.
• P. Tan, M. Steinbach, and V. Kumar. Introduction to Data Mining. Addison Wesley, 2005.
• S. M. Weiss and C. A. Kulikowski. Computer Systems that Learn: Classification and Prediction
Methods from Statistics, Neural Nets, Machine Learning, and Expert Systems. Morgan
Kaufman, 1991.
• S. M. Weiss and N. Indurkhya. Predictive Data Mining. Morgan Kaufmann, 1997.
• I. H. Witten and E. Frank. Data Mining: Practical Machine Learning Tools and Techniques, 2ed.
Morgan Kaufmann, 2005.
• X. Yin and J. Han. CPAR: Classification based on predictive association rules. SDM'03
• H. Yu, J. Yang, and J. Han. Classifying large data sets using SVM with hierarchical clusters.
KDD'03.