Data Mining Classification: Alternative TechniquesClassification OverviewClassification OverviewClassification OverviewExampleExampleExampleExampleExampleExampleInstance-Based ClassifiersInstance Based ClassifiersNearest Neighbor ClassifiersNearest-Neighbor ClassifiersDefinition of Nearest NeighborNearest Neighbor ClassificationNearest Neighbor Classification…Nearest Neighbor Classification…Nearest Neighbor Classification…Nearest neighbor Classification…Bayes ClassifierExample of Bayes TheoremBayesian ClassifiersBayesian ClassifiersNaïve Bayes ClassifierHow to Estimate Probabilities from Data?How to Estimate Probabilities from Data?How to Estimate Probabilities from Data?Example of Naïve Bayes ClassifierNaïve Bayes ClassifierExample of Naïve Bayes ClassifierNaïve Bayes (Summary)Ensemble MethodsGeneral IdeaWhy does it work?Examples of Ensemble MethodsBaggingBoostingBoostingExample: AdaBoostExample: AdaBoostSlide 42When is Bootstrapping Not Applicable?BaggingBagging ObservationsBoostingBoosting in a PictureBoosting IntuitionBoosting: A Pictorial ExampleRound 1Round 2Round 3Final ClassifierIllustrating AdaBoostIllustrating AdaBoost© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 1 Data Mining Classification: Alternative TechniquesLecture Notes for Chapter 5Introduction to Data MiningbyTan, Steinbach, Kumar© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 1© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 2 Classification OverviewAssigning data to discrete categories© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 3 Classification OverviewAssigning data to discrete categoriesTrain a model on labeled dataSpamNot spam© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 4 Classification OverviewAssigning data to discrete categoriesTrain a model on labeled dataRun the model on new, unlabeled dataSpamNot spam?© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 5 ExampleNot spam© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 6 ExamplePresident Obama’s Nobel Prize SpeechNot spam© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 7 ExampleSpam© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 8 ExampleSpamSpam email content© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 9 Example© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 10 Example“Order a trial Adobe chicken dailyEAB-List new summer savings, welcome!”© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 11 Instance-Based Classifiers• Store the training records • Use training records to predict the class label of unseen casesAtr1……...AtrN ClassABBCACBSet of Stored CasesAtr1……...AtrNUnseen Case© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 12 Instance Based ClassifiersExamples:–Rote-learner Memorizes entire training data and performs classification only if attributes of record match one of the training examples exactly–Nearest neighbor Uses k “closest” points (nearest neighbors) for performing classification© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 13 Nearest Neighbor ClassifiersBasic idea:–If it walks like a duck, quacks like a duck, then it’s probably a duckTraining RecordsTest RecordCompute DistanceChoose k of the “nearest” records© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 14 Nearest-Neighbor ClassifiersRequires three things–The set of stored records–Distance Metric to compute distance between records–The value of k, the number of nearest neighbors to retrieveTo classify an unknown record:–Compute distance to other training records–Identify k nearest neighbors –Use class labels of nearest neighbors to determine the class label of unknown record (e.g., by taking majority vote)© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 15 Definition of Nearest Neighbor K-nearest neighbors of a record x are data points that have the k smallest distance to xXXX(a) 1-nearest neighbor (b) 2-nearest neighbor (c) 3-nearest neighbor© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 16 Nearest Neighbor ClassificationCompute distance between two points:–Euclidean distance Determine the class from nearest neighbor list–take the majority vote of class labels among the k-nearest neighbors–Weigh the vote according to distance weight factor, w = 1/d2iiiqpqpd2)(),(© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 17 Nearest Neighbor Classification…Choosing the value of k:–If k is too small, sensitive to noise points–If k is too large, neighborhood may include points from other classes© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 18 Nearest Neighbor Classification…Scaling issues–Attributes may have to be scaled to prevent distance measures from being dominated by one of the attributes–Example: height of a person may vary from 1.5m to 1.8m weight of a person may vary from 90lb to 300lb income of a person may vary from $10K to $1M© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 19 Nearest Neighbor Classification…Problem with Euclidean measure:–High dimensional data curse of dimensionality–Can produce counter-intuitive results1 1 1 1 1 1 1 1 1 1 1 00 1 1 1 1 1 1 1 1 1 1 11 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 1vsd = 1.4142 d = 1.4142 Solution: Normalize the vectors to unit length© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 20 Nearest neighbor Classification…k-NN classifiers are lazy learners –It does not build models explicitly–Unlike eager learners such as decision tree induction and rule-based systems–Classifying unknown records are relatively expensive© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 21 Bayes ClassifierA probabilistic framework for solving classification problemsConditional Probability: Bayes theorem:)()()|()|(APCPCAPACP
View Full Document