DM 352 Syllabus | DM 552 Syllabus

last updated 12-Aug-2021

Another **unsupervised** data mining technique. --No targeted class variable identified.

**Cluster Analysis:** Finding groups of objects such that the objects in a group are similar (or related) to one another and different from (or unrelated to) the objects in other group.

Usually characterize each cluster using means, medians, modes of the attributes for the instances in the cluster.

**Understanding**: Group related documents for browsing, group genes and proteins that have similar functionality, or group stocks with similar price fluctuations

**Summarization**: reduce the size of a large dataset

Simple segmentation:Dividing students into different registration groups alphabetically, by last name

Results of a query:Groupings are a result of an external specification. Clustering, instead, is a grouping of objects based on the data.

Supervised classification:Have class label information

Association Analysis:Local vs. global connections

A set of clusters

A division of data objects into non-overlapping subsets (clusters) such that each data object is in exactly one subset

A set of nested clusters organized as a hierarchical tree

**Exclusive versus non-exclusive**

- In non-exclusive clusterings, points may belong to multiple clusters.
- Can represent multiple classes or ‘border’ points

**Fuzzy versus non-fuzzy**

- In fuzzy clustering, a point belongs to every cluster with some weight between 0 and 1
- Weights must sum to 1
- Probabilistic clustering has similar characteristics

**Partial versus complete**

- In some cases, we only want to cluster some of the data

**Heterogeneous versus homogeneous**

- Clusters of widely different sizes, shapes, and densities

**Well-separated clusters: **A cluster is a set of points such that any point in a cluster is closer (or more similar) to every other point in the cluster than to any point not in the cluster.

**Center-based clusters**

- A cluster is a set of objects such that an object in a cluster is closer (more similar) to the “center” of a cluster, than to the center of any other cluster.
- The center of a cluster is often a
**centroid**, the average of all the points in the cluster, or a**medoid**, the most “representative” point of a cluster.

**Contiguous clusters **(Nearest neighbor or Transitive)

A cluster is a set of points such that a point in a cluster is closer (or more similar) to one or more other points in the cluster than to any point not in the cluster.

**Density-based clusters**

- A cluster is a dense region of points, which is separated by low-density regions, from other regions of high density.
- Used when the clusters are irregular or intertwined, and when noise and outliers are present.

**Shared Property or Conceptual clusters**

clusters that share some common property or represent a particular concept

**Described by an Objective Function**

Finds clusters that minimize or maximize an objective function.

Enumerate all possible ways of dividing the points into clusters and evaluate the `goodness' of each potential set of clusters by using the given objective function. (NP Hard algorithm complexity)

Can have global or local objectives.

- Hierarchical clustering algorithms typically have local objectives
- Partitional algorithms typically have global objectives

A variation of the global objective function approach is to fit the data to a parameterized model.

- Parameters for the model are determined from the data.
- Mixture models assume that the data is a ‘mixture' of a number of statistical distributions.

Examples:

Sum of Squared Error(SSE) using Eucliean distances

Document data--document term matrix and using cosine similarity measure.

Type of proximity or density measure

- Central to clustering
- Depends on data and application

Data characteristics that affect proximity and/or density are

- Dimensionality or Sparseness
- Attribute type
- Special relationships in the data, for example, autocorrelation
- Distribution of the data

Noise and Outliers

- Often interfere with the operation of the clustering algorithm

K-means and its variants

Hierarchical clustering

Density-based clustering

Partitional clustering approach

Number of clusters, K, must be specified

Each cluster is associated with a centroid (center point)

Each point is assigned to the cluster with the closest centroid

Initial centroids are often chosen randomly.

- Clusters produced can vary from one run to another.

The centroid is (typically) the mean of the points in the cluster.

‘Closeness’ is measured by Euclidean distance, cosine similarity, correlation, etc.

K-means will converge for common similarity measures mentioned above.

Most of the convergence happens in the first few iterations.

- Often the stopping condition is changed to ‘Until relatively few points change clusters’

Complexity is O( n * K * I * d )

- n = number of points, K = number of clusters,

I = number of iterations, d = number of attributes

Clustering Animations at https://www.naftaliharris.com/blog/visualizing-k-means-clustering/

Most common measure is Sum of Squared Error (SSE)

For each point, the error is the distance to the nearest cluster

To get SSE, we square these errors and sum them.

is a data point in clusterxandC_{i}is the representative point for clusterm_{i}C_{i}_{}

- can show that m
_{i}corresponds to the center (mean) of the clusterGiven two sets of clusters, we prefer the one with the smallest error

One easy way to reduce SSE is to increase K, the number of clusters

- A good clustering with smaller K can have a lower SSE than a poor clustering with higher K

Essentially run the k-means algorithm with increasing k. Graph the SSE against k and look for the point that SSE stops decreasing significantly-- the "elbow bend" point and choose your k there. Of course this is a bit subjective.

Here are two sample graphs that reflect the idea. Dataset A has a clear k of 3. Dataset B is not so clear: 2 or 3 or 4? or 6 or 7? Possibly 4 in this case.

[Image taken from URL: https://medium.com/analytics-vidhya/how-to-determine-the-optimal-k-for-k-means-708505d204eb]

K-means has problems when clusters are of differing

- Sizes

- Densities

- Non-globular shapes

K-means also has problems when the data contains outliers.

Good initial centroids

Not so good....

If there are K ‘real’ clusters then the chance of selecting one centroid from each cluster is small.

- Chance is relatively small when K is large
- If clusters are the same size, n, then

- For example, if K = 10, then probability = 10!/10
^{10}= 0.00036 - Sometimes the initial centroids will readjust themselves in ‘right’ way, and sometimes they don’t
- Consider an example of five pairs of clusters

Multiple runs - Helps, but probability is not on your side

Sample and use hierarchical clustering to determine initial centroids

Select more than k initial centroids and then select among these initial centroids

- Select most widely separated
Postprocessing

Generate a larger number of clusters and then perform a hierarchical clustering

Bisecting K-means

- Not as susceptible to initialization issues

Variant of K-means that can produce a partitional or a hierarchical clustering

This approach can be slower than random initialization, but very consistently produces better results in terms of SSE

The k-means++ algorithm guarantees an approximation ratio of O(log k) in expectation, where k is the number of centers

To select a set of initial centroids, C, perform the following

K-means can yield empty clusters.

Several strategies to resolve the problem.

- Choose the point that contributes most to SSE as the new centroid
- Choose a point from the cluster with the highest SSE
- If there are several empty clusters, the above can be repeated several times.

In the basic K-means algorithm, centroids are updated after all points are assigned to a centroid

An alternative is to update the centroids after each assignment (incremental approach)

- Each assignment updates zero or two centroids
- More expensive
- Introduces an order dependency
- Never get an empty cluster
- Can use “weights” to change the impact

Normalize the data

Eliminate outliers

- Outliers can greatly influence the clusters.
- Eliminate cautiously; outliers are often interesting instances

Eliminate small clusters that may represent outliers

Split ‘loose’ clusters, i.e., clusters with relatively high SSE

Merge clusters that are ‘close’ and that have relatively low SSE

Can use these steps during the clustering process (ISODATA)