[Artificial Intelligence] - Unsupervised learning, K-means clustering (K-means clustering), K-means loss function, objective function

[Artificial Intelligence] - Unsupervised learning, K-means clustering (K-means clustering), K-means loss function, objective function

unsupervised learning

Unsupervised learning refers to learning on unlabeled data, that is, model training without the guidance of supervisory signals. In unsupervised learning, we mainly focus on learning the low-dimensional structure and hidden patterns of data from unlabeled data.

With unlabeled data, we can predict the following:

  1. Low-dimensional structure: Through unsupervised learning algorithms such as principal component analysis (PCA), we can discover the main direction of change and low-dimensional representation in the data, helping us understand the internal structure of the data and perform data dimensionality reduction.
  2. Cluster structure: Through clustering algorithms such as K-means clustering or hierarchical clustering, we can divide unlabeled data into different groups or categories, thereby discovering the cluster structure in the data.
  3. Association rules: Through association rule mining algorithms such as Apriori algorithm or FP-growth algorithm, we can discover frequent itemsets and association rules in the data, and reveal the association relationship between different features.

Clustering

• Group data objects into subsets or "clusters":

  • High similarity within the cluster
  • low similarity between clusters

• Clustering is a common and important task with widespread applications in science, engineering, information science, and other fields:

  • Group genes with the same function
  • Group individuals with similar political views
  • Categorize documents with similar topics
  • Identify similar objects from pictures

insert image description here

Input: Training set of input points
Output: Assign each point to a cluster
where D train = { x 1 , . . . , xn } Dtrain = \{x1, ..., xn\}Dtrain={ x 1 ,...,x n } is the training set of input points
( C ( 1 ) , . . . , C ( n ) ) (C(1), ..., C(n))(C(1),...,C ( n )) is the cluster to which each point is assigned, whereC ( i ) C(i)C ( i ) belongs to{ 1 , . . . , k } \{1, ..., k\}{ 1,...,k } indicates the cluster to which the i-th point belongs.

K-means clustering (K-means clustering)

The goal of K-means is to minimize the sum of squares of the Euclidean distances between all data points and the center points of the clusters they belong to.

The algorithm process of K-means is as follows:

  1. Randomly select K initial cluster center points (centroids).
  2. Assigns each data point to the cluster corresponding to its nearest cluster center point.
  3. Update the center point of each cluster to be the mean of all data points in that cluster.
  4. Repeat step 2 and step 3 until the center point of the cluster no longer changes significantly or reaches the predetermined number of iterations.

K-means loss function

x \textbf{x} x is the sample,μ C ( j ) μ_{C(j)}mC ( j )Represents a certain cluster C ( j ) C(j)The center of C ( j ) ,
the following formula expresses thatxj x_jxjassigned to C ( j ) C(j)When C ( j ) is on this cluster, to the cluster centerμ C ( j ) μ_{C(j)}mC ( j )The sum of the Euclidean distances of
insert image description here

objective function

Find out how to divide the cluster CCC. How to choose the cluster centerμ μμ , so that the sum of the Euclidean distances from each cluster sample to the cluster center is the smallest
insert image description here

Strategy: Alternate Minimization

  • Step 1: If the cluster centers are known, the best CC can be foundC

    • Fixed μ μμ , optimizeCCC
      insert image description here
      assigns each point to the nearest cluster center
  • Step 2: If you know the cluster allocation CCC , can find the best cluster centerμ μm

    • Fixed CCC , optimizeμ μμ
      insert image description here
      Solutions: PartIISelect the average value of all points of the cluster in the i cluster as the cluster center again, which is exactly step 2 (reselect the cluster center)

Guess you like

Origin blog.csdn.net/weixin_56462041/article/details/131276658