1 / 29

Machine Learning CS 165B Spring 2012

This course covers the fundamentals of clustering algorithms, including concept learning, ensemble learning, decision trees, neural networks, linear classifiers, support vector machines, Bayesian learning, genetic algorithms, instance-based learning, and computational learning theory.

mkahl
Download Presentation

Machine Learning CS 165B Spring 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Machine LearningCS 165BSpring 2012

  2. Course outline • Introduction (Ch. 1) • Concept learning (Ch. 2) • Decision trees (Ch. 3) • Ensemble learning • Neural Networks (Ch. 4) • Linear classifiers • Support Vector Machines • Bayesian Learning (Ch. 6) • Genetic Algorithms (Ch. 9) • Instance-based Learning (Ch. 8) • Clustering • Computational learning theory (Ch. 7)

  3. What is clustering? • Organizing data into classes such that there is • high intra-class similarity • low inter-class similarity • Finding the class labels and the number of classes directly from the data (in contrast to classification). • More informally, finding natural groupings among objects. Remember Fischer’s discriminant

  4. What is a natural grouping among these objects?

  5. What is a natural grouping among these objects? Clustering is subjective Simpson's Family Females Males School Employees

  6. What is similarity? The quality or state of being similar; likeness; resemblance; as, a similarity of features. Webster's Dictionary Similarity is hard to define, but… “We know it when we see it” The real meaning of similarity is a philosophical question. We will take a more pragmatic approach.

  7. Defining distance measures Definition: Let O1 and O2 be two objects from the universe of possible objects. The distance (dissimilarity) between O1 and O2 is a real number denoted by D(O1,O2) Peter Piotr 0.23 3 342.7

  8. Peter Piotr When we peek inside one of these black boxes, we see some function on two variables. These functions might very simple or very complex. In either case it is natural to ask, what properties should these functions have? d('', '') = 0 d(s, '') = d('', s) = |s| -- i.e. length of s d(s1+ch1, s2+ch2) = min( d(s1, s2) + if ch1=ch2 then 0 else 1 fi, d(s1+ch1, s2) + 1, d(s1, s2+ch2) + 1 ) 3 • What properties should a distance measure have? • D(A,B) = D(B,A) Symmetry • D(A,B) = 0 iff A= B Reflexive • D(A,B)  D(A,C) + D(B,C) Triangle Inequality

  9. Two types of clustering • Partitional algorithms: Construct various partitions and then evaluate them by some criterion • Hierarchical algorithms: Create a hierarchical decomposition of the set of objects using some criterion Partitional Hierarchical

  10. Desirable Properties of clustering algorithm • Scalability (in terms of both time and space) • Ability to deal with different data types • Minimal requirements for domain knowledge to determine input parameters • Able to deal with noise and outliers • Insensitive to order of input records • Incorporation of user-specified constraints • Interpretability and usability

  11. Summarizing similarity measurements In order to better appreciate and evaluate the examples given in the early part of this talk, we will now introduce the dendrogram. The similarity between two objects in a dendrogram is represented as the height of the lowest internal node they share.

  12. Hierarchical clustering using string edit distance Pedro(Portuguese) Petros (Greek), Peter (English), Piotr (Polish), Peadar (Irish), Pierre (French), Peder (Danish), Peka (Hawaiian), Pietro (Italian), Piero (Italian Alternative), Petr (Czech), Pyotr (Russian) Cristovao(Portuguese) Christoph (German), Christophe (French), Cristobal (Spanish), Cristoforo (Italian), Kristoffer (Scandinavian), Krystof (Czech), Christopher (English) Miguel(Portuguese) Michalis (Greek), Michael (English), Mick (Irish!) Piotr Peka Mick Peter Piero Pedro Pyotr Peder Pierre Pietro Petros Miguel Peadar Krystof Michael Michalis Crisdean Cristobal Christoph Cristovao Kristoffer Cristoforo Christophe Christopher

  13. (How-to) Hierarchical clustering Since we cannot test all possible trees we will have to use heuristics: Bottom-Up (agglomerative): Starting with each item in its own cluster, find the best pair to merge into a new cluster. Repeat until all clusters are fused together. Top-Down (divisive): Starting with all the data in a single cluster, consider every possible way to divide the cluster into two. Choose the best division and recursively operate on both sides. • The number of dendrograms with n leafs = (2n -3)!/[(2(n -2)) (n -2)!] • Number Number of Possible • of Leafs Dendrograms • 2 1 • 3 3 • 4 15 • 5 105 • ... … • 34,459,425

  14. 0 4 8 8 7 7 0 2 0 3 3 0 1 0 4 Distance matrix We begin with a distance matrix which contains the distances between every pair of objects in our database. D( , ) = 8 D( , ) = 1

  15. Bottom-Up (agglomerative) Starting with each item in its own cluster, find the best pair to merge into a new cluster. Repeat until all clusters are fused together. Consider all possible merges… Choose the best …

  16. Bottom-Up (agglomerative) Starting with each item in its own cluster, find the best pair to merge into a new cluster. Repeat until all clusters are fused together. Consider all possible merges… Choose the best … Consider all possible merges… Choose the best …

  17. Bottom-Up (agglomerative) Starting with each item in its own cluster, find the best pair to merge into a new cluster. Repeat until all clusters are fused together. Consider all possible merges… Choose the best … Consider all possible merges… Choose the best … Consider all possible merges… Choose the best …

  18. Bottom-Up (agglomerative) Starting with each item in its own cluster, find the best pair to merge into a new cluster. Repeat until all clusters are fused together. Consider all possible merges… Choose the best … Consider all possible merges… Choose the best … Consider all possible merges… Choose the best …

  19. Extending distance measure to clusters We know how to measure the distance between two objects, but defining the distance between an object and a cluster, or defining the distance between two clusters is not obvious. • Single linkage (nearest neighbor):In this method the distance between two clusters is determined by the distance of the two closest objects (nearest neighbors) in the different clusters. • Complete linkage (farthest neighbor):In this method, the distances between clusters are determined by the greatest distance between any two objects in the different clusters (i.e., by the "furthest neighbors"). • Group average linkage:In this method, the distance between two clusters is calculated as the average distance between all pairs of objects in the two different clusters.

  20. Summary of hierarchal clustering • No need to specify the number of clusters in advance. • Hierarchal nature maps nicely onto human intuition for some domains • They do not scale well: time complexity of at least O(n2), where n is the number of total objects. • Like any heuristic search algorithms, local optima are a problem.

  21. Partitional clustering • Nonhierarchical, each instance is placed in exactly one of K nonoverlapping clusters. • Since only one set of clusters is output, the user normally has to input the desired number of clusters K.

  22. Algorithm k-means 1. Decide on a value for k. 2. Initialize the k cluster centers (randomly, if necessary). 3. Decide the class memberships of the N objects by assigning them to the nearest cluster center. 4. Re-estimate the k cluster centers, by assuming the memberships found above are correct. 5. If none of the N objects changed membership in the last iteration, exit. Otherwise goto 3.

  23. k3 k1 k2 K-means clustering: step 1 Algorithm: k-means, Distance Metric: Euclidean Distance 5 4 3 2 1 0 0 1 2 3 4 5

  24. k3 k1 k2 K-means clustering: step 2 Algorithm: k-means, Distance Metric: Euclidean Distance 5 4 3 2 1 0 0 1 2 3 4 5

  25. k3 k1 k2 K-means clustering: step 3 Algorithm: k-means, Distance Metric: Euclidean Distance 5 4 3 2 1 0 0 1 2 3 4 5

  26. k3 k1 k2 K-means clustering: step 4 Algorithm: k-means, Distance Metric: Euclidean Distance 5 4 3 2 1 0 0 1 2 3 4 5

  27. k1 k2 k3 K-means clustering: step 5 Algorithm: k-means, Distance Metric: Euclidean Distance

  28. Evaluation of K-means • Strength • Relatively efficient: O(tkn), where n is # objects, k is # clusters, and t is # iterations. Normally, k, t << n. • Often terminates at a local optimum. The global optimum may be found using techniques such as: deterministic annealing and genetic algorithms • Weakness • Applicable only when mean is defined, then what about categorical data? • Need to specify k, the number of clusters, in advance • Unable to handle noisy data and outliers • Not suitable for clusters with non-convex shapes

  29. Other clustering methods • Density based clustering • Subspace clustering • EM clustering • Gaussian Mixture Models • Other concepts • Dimensionality reduction • PCA

More Related