Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Textmining Predictive Models


Published on

Textmining Predictive Models

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

Textmining Predictive Models

  1. 1. Text mining: Predictive models for text
  2. 2. Document Classification <ul><li>Document classification/categorization is a problem in text mining. The task is to assign an document to one or more categories, based on its contents </li></ul>
  3. 3. Classification Techniques <ul><li>nearest-neighbor </li></ul><ul><li>Decision rules </li></ul><ul><li>Probabilistic models </li></ul><ul><li>Linear models </li></ul>
  4. 4. K-nearest neighbor algorithm <ul><li>Given a distance metric </li></ul><ul><li>Assign class to be the same as its nearest neighbor </li></ul><ul><li>All training data is used during operation </li></ul><ul><li>Multi-class decision framework </li></ul>
  5. 5. K-nearest neighbor algorithm <ul><li>Simple algorithm is slow </li></ul><ul><ul><li>For each x i </li></ul></ul><ul><ul><ul><li>if (dist( x , x i ) < min) </li></ul></ul></ul><ul><ul><ul><ul><li>nearest = x i </li></ul></ul></ul></ul><ul><ul><ul><ul><li>min = dist( x , x i ) </li></ul></ul></ul></ul><ul><li>Use data structures to speed up search </li></ul>
  6. 6. Advantages <ul><li>it is well suited for multi-modal classes as its classification decision is based on a small neighborhood of similar objects (i.e., the major class). </li></ul><ul><li>So, even if the target class is multi-modal (i.e., consists of objects whose independent variables have different characteristics for different subsets), it can still lead to good accuracy. </li></ul>
  7. 7. DRAWBACKS <ul><li>A major drawback of the similarity measure used in KNN is that it uses all features equally in computing similarities. This can lead to poor similarity measures and classification errors, when only a small subset of the features is useful for classification </li></ul>
  8. 8. Decision trees Decision trees are popular for pattern recognition because the models they produce are easier to understand. Root node A A B B B B <ul><li>Nodes of the tree </li></ul><ul><li>Leaves (terminal nodes) of the tree </li></ul><ul><li>Branches (decision point) of the tree </li></ul>C
  9. 9. Binary decision trees <ul><li>Since each inequality that is used to split the input space is only based on one input variable. </li></ul><ul><li>Each node draws a boundary that can be geometrically interpreted as a hyper plane perpendicular to the axis </li></ul>
  10. 10. Linear decision trees <ul><li>Linear decision trees are similar to binary decision trees, except that the inequality computed at each node takes on an arbitrary linear from that may depend on multiple variables. </li></ul>
  11. 11. Probabilistic model-Naive Bayes classifier <ul><li>a naive Bayes classifier assumes that the presence (or absence) of a particular feature of a class is unrelated to the presence (or absence) of any other feature. </li></ul><ul><li>Example: </li></ul><ul><li>a fruit may be considered to be an apple if it is red, round, and about 4&quot; in diameter. Even though these features depend on the existence of the other features, a naive Bayes classifier considers all of these properties to independently contribute to the probability that this fruit is an apple. </li></ul>
  12. 12. Parameter estimation <ul><li>All model parameters can be approximated with relative frequencies from the training set. </li></ul><ul><li>If a given class and feature value never occur together in the training set then the frequency-based probability estimate will be zero. </li></ul><ul><li>This is problematic since it will wipe out all information in the other probabilities when they are multiplied. It is therefore often desirable to incorporate a small-sample correction in all probability estimates such that no probability is ever set to be exactly zero. </li></ul>
  13. 13. Constructing a classifier from the probability model <ul><li>The naive Bayes classifier combines this model with a decision rule. One common rule is to pick the hypothesis that is most probable. </li></ul><ul><li>This is known as the maximum a posteriori or MAP decision rule. The corresponding classifier is the function classify defined as follows: </li></ul><ul><li>Classify(f1,f2…fn)=argmax p(C=c)∏ p(Fi=fi)/(C=c) </li></ul>
  14. 14. Performance Evaluation <ul><li>Given n test documents and m classes in consideration, a classifier makes n  m binary decisions. A two-by-two contingency table can be computed for each class. </li></ul><ul><li>Truly yes truly no </li></ul><ul><li>System yes a b </li></ul><ul><li>System No c d </li></ul>
  15. 15. Performance Evaluation <ul><li>Recall = a/(a+c) where a + c > 0 (o.w. undefined). </li></ul><ul><ul><li>Did we find all of those that belonged in the class? </li></ul></ul><ul><li>Precision = a/(a+b) where a+b>0 (o.w. undefined). </li></ul><ul><ul><li>Of the times we predicted it was “in class”, how often are we correct? </li></ul></ul>
  16. 16. Performance Evaluation <ul><li>Accuracy = (a + d) / n </li></ul><ul><ul><li>When one classes is overwhelmingly in the majority, this may not paint an accurate picture. </li></ul></ul><ul><li>Others: miss, false alarm (fallout), error, F-measure, break-even point, ... </li></ul>
  17. 17. Applications <ul><li>Web pages organized into category hierarchies </li></ul><ul><li>Journal articles indexed by subject categories (e.g., the Library of Congress, MEDLINE, etc.) </li></ul><ul><li>Responses to Census Bureau occupations </li></ul><ul><li>Patents archived using International Patent Classification </li></ul><ul><li>Patient records coded using international insurance categories </li></ul><ul><li>E-mail message filtering </li></ul><ul><li>News events tracked and filtered by topics </li></ul>
  18. 18. conclusion <ul><li>In this presentation we learned about </li></ul><ul><li>Document classification </li></ul><ul><li>Classification techniques </li></ul><ul><li>Performance evaluation and </li></ul><ul><li>applications </li></ul>
  19. 19. Visit more self help tutorials <ul><li>Pick a tutorial of your choice and browse through it at your own pace. </li></ul><ul><li>The tutorials section is free, self-guiding and will not involve any additional support. </li></ul><ul><li>Visit us at </li></ul>