{'fraction_non_alphanumeric': 0.04642044629459315, 'fraction_numerical': 0.008083643932426545, 'mean_word_length': 4.404132879937222, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Semi-Supervised Information-Maximization Clustering

Semi-supervised clustering aims to introduce prior knowledge in the decision process of a clustering algorithm. In this paper, we propose a novel semi-supervised clustering algorithm based on the information-maximization principle. The proposed method is an extension of a previous unsupervised information-maximization clustering algorithm based on squared-loss mutual information to effectively incorporate must-links and cannot-links. The proposed method is computationally efficient because the clustering solution can be obtained analytically via eigendecomposition. Furthermore, the proposed method allows systematic optimization of tuning parameters such as the kernel width, given the degree of belief in the must-links and cannot-links. The usefulness of the proposed method is demonstrated through experiments.


Introduction
The objective of clustering is to classify unlabeled data into disjoint groups based on their similarity, and clustering has been extensively studied in statistics and machine learning. K-means [12] is a classic algorithm that clusters data so that the sum of within-cluster scatters is minimized. However, its usefulness is rather limited in practice because k-means only produces linearly separated clusters. Kernel k-means [5] overcomes this limitation by performing k-means in a feature space induced by a reproducing kernel function [15]. Spectral clustering [17,13] first unfolds non-linear data manifolds based on sample-sample similarity by a spectral embedding method, and then performs k-means in the embedded space.
These non-linear clustering techniques is capable of handling highly complex real-world data. However, they lack objective model selection strategies, i.e., tuning parameters included in kernel functions or similarity measures need to be manually determined in an unsupervised manner. Information-maximization clustering can address the issue of model selection [1,7,18], which learns a probabilistic classifier so that some information measure between feature vectors and cluster assignments is maximized in an unsupervised manner. In the information-maximization approach, tuning parameters included in kernel functions or similarity measures can be systematically determined based on the information-maximization principle. Among the information-maximization clustering methods, the algorithm based on squared-loss mutual information (SMI) was demonstrated to be promising [18], because it gives the clustering solution analytically via eigendecomposition.
In practical situations, additional side information regarding clustering solutions is often provided, typically in the form of must-links and cannot-links: A set of sample pairs which should belong to the same cluster and a set of sample pairs which should belong to different clusters, respectively. Such semisupervised clustering (which is also known as clustering with side information) has been shown to be useful in practice [22,6,23]. Spectral learning [9] is a semisupervised extension of spectral clustering that enhances the similarity with side information so that sample pairs tied with must-links have higher similarity and sample pairs tied with cannot-links have lower similarity. On the other hand, constrained spectral clustering [24] incorporates the must-links and cannot-links as constraints in the optimization problem.
However, in the same way as unsupervised clustering, the above semisupervised clustering methods suffer from lack of objective model selection strategies and thus tuning parameters included in similarity measures need to be determined manually. In this paper, we extend the unsupervised SMI-based clustering method to the semi-supervised clustering scenario. The proposed method, called semi-supervised SMI-based clustering (3SMIC), gives the clustering solution analytically via eigendecomposition with a systematic model selection strategy. Through experiments on real-world datasets, we demonstrate the usefulness of the proposed 3SMIC algorithm.

Information-Maximization Clustering with Squared-Loss Mutual Information
In this section, we formulate the problem of information-maximization clustering and review an existing unsupervised clustering method based on squared-loss mutual information.

Information-Maximization Clustering
The goal of unsupervised clustering is to assign class labels to data instances so that similar instances share the same label and dissimilar instances have different labels. Let {x i |x i ∈ R d } n i=1 be feature vectors of data instances, which are drawn independently from a probability distribution with density p * (x). Let {y i |y i ∈ {1, . . . , c}} n i=1 be class labels that we want to obtain, where c denotes the number of classes and we assume c to be known through the paper.
The information-maximization approach tries to learn the class-posterior probability p * (y|x) in an unsupervised manner so that some "information" measure between feature x and label y is maximized. Mutual information (MI) [16] is a typical information measure for this purpose [1,7]: An advantage of the information-maximization formulation is that tuning parameters included in clustering algorithms such as the Gaussian width and the regularization parameter can be objectively optimized based on the same information-maximization principle. However, MI is known to be sensitive to outliers [3], due to the log function that is strongly non-linear. Furthermore, unsupervised learning of class-posterior probability p * (y|x) under MI is highly non-convex and finding a good local optimum is not straightforward in practice [7].
To cope with this problem, an alternative information measure called squaredloss MI (SMI) has been introduced [21]: Ordinary MI is the Kullback-Leibler (KL) divergence [10] from p * (x, y) to p * (x)p * (y), while SMI is the Pearson (PE) divergence [14]. Both KL and PE divergences belong to the class of the Ali-Silvey-Csiszár divergences [2,4], which is also known as the f -divergences. Thus, MI and SMI share many common properties, for example they are non-negative and equal to zero if and only if feature vector x and label y are statistically independent. Information-maximization clustering based on SMI was shown to be computationally advantageous [18]. Below, we review the SMI-based clustering (SMIC) algorithm.

SMI-Based Clustering
In unsupervised clustering, it is not straightforward to approximate SMI (2) because labeled samples are not available. To cope with this problem, let us expand the squared term in Eq. (2). Then SMI can be expressed as Suppose that the class-prior probability p * (y) is uniform, i.e., p(y) = 1 c for y = 1, . . . , c.
Then we can express Eq.(3) as Let us approximate the class-posterior probability p * (y|x) by the following kernel model: where α = (α 1,1 , . . . , α c,n ) ⊤ ∈ R cn is the parameter vector, ⊤ denotes the transpose, and K(x, x ′ ) denotes a kernel function. Let K be the kernel matrix whose (i, j) element is given by K(x i , x j ) and let α y = (α y,1 , . . . , α y,n ) ⊤ ∈ R n . Approximating the expectation over p * (x) in Eq.(4) with the empirical average of samples {x i } n i=1 and replacing the class-posterior probability p * (y|x) with the kernel model p(y|x; α), we have the following SMI approximator: Under orthonormality of {α y } c y=1 , a global maximizer is given by the normalized eigenvectors φ 1 , . . . , φ c associated with the eigenvalues λ 1 ≥ · · · ≥ λ n ≥ 0 of K. Because the sign of eigenvector φ y is arbitrary, we set the sign as where sign(·) denotes the sign of a scalar and 1 n denotes the n-dimensional vector with all ones. On the other hand, since and the class-prior probability was set to be uniform, we have the following normalization condition: Furthermore, negative outputs are rounded up to zero to ensure that outputs are non-negative. Taking these post-processing issues into account, cluster assignment y i for x i is determined as the maximizer of the approximation of p(y|x i ): where 0 n denotes the n-dimensional vector with all zeros, the max operation for vectors is applied in the element-wise manner, and [·] i denotes the i-th element of a vector. Note that K φ y = λ y φ y is used in the above derivation.
For out-of-sample prediction, cluster assignment y ′ for new sample x ′ may be obtained as This clustering algorithm is called the SMI-based clustering (SMIC). SMIC may include a tuning parameter, say θ, in the kernel function, and the clustering results of SMIC depend on the choice of θ. A notable advantage of information-maximization clustering is that such a tuning parameter can be systematically optimized by the same information-maximization principle. More specifically, cluster assignments {y θ i } n i=1 are first obtained for each possible θ. Then the quality of clustering is measured by the SMI value estimated from For this purpose, the method of least-squares mutual information (LSMI) [21] is useful because LSMI was theoretically proved to be the optimal non-parametric SMI approximator [20]; see Appendix A for the details of LSMI. Thus, we compute LSMI as a function of θ and the tuning parameter value that maximizes LSMI is selected as the most suitable one: In this section, we extend SMIC to a semi-supervised clustering scenario where a set of must-links and a set of cannot-links are provided. A must-link (i, j) means that x i and x j are encouraged to belong to the same cluster, while a cannot-link (i, j) means that x i and x j are encouraged to belong to different clusters. Let M be the must-link matrix with M i,j = 1 if a must-link between x i and x j is given and M i,j = 0 otherwise. In the same way, we define the cannot-link matrix C. We assume that M i,i = 1 for all i = 1, . . . , n, and C i,i = 0 for all i = 1, . . . , n. Below, we explain how must-link constraints and cannot-link constraints are incorporated into the SMIC formulation.

Incorporating Must-Links in SMIC
When there exists a must-link between x i and x j , we want them to share the same class label. Let be the soft-response vector for x i . Then the inner product p * i , p * j is maximized if and only if x i and x j belong to the same cluster with perfect confidence, i.e., p * i and p * j are the same vector that commonly has 1 in one element and 0 otherwise. Thus, the must-link information may be utilized by increasing p * i , p * j if M i,j = 1. We implement this idea as where γ ≥ 0 determines how strongly we encourage the must-links to be satisfied. Let us further utilize the following fact: If x i and x j belong to the same class and x j and x k belong to the same class, x i and x k also belong to the same class (i.e., a friend's friend is a friend). Letting M ′ i,j = n k=1 M i,k M k,j , we can incorporate this in SMIC as If we set γ ′ = γ 2 , we have a simpler form: which will be used later.

Incorporating Cannot-Links in SMIC
We may incorporate cannot-links in SMIC in the opposite way to must-links, by decreasing the inner product p * i , p * j to zero. This may be implemented as where η ≥ 0 determines how strongly we encourage the cannot-links to be satisfied.
In binary clustering problems where c = 2, if x i and x j belong to different classes and x j and x k belong to different classes, x i and x k actually belong to the same class (i.e., an enemy's enemy is a friend). Let C ′ i,j = n k=1 C i,k C k,j , and we will take this also into account as must-links in the following way: which will be used later.

Kernel Matrix Modification
Another approach to incorporating must-links and cannot-links is to modify the kernel matrix K. More specifically, K i,j is increased if there exists a must-link between x i and x j , and K i,j is decreased if there exists a cannot-link between x i and x j . In this paper, we assume K i,j ∈ [0, 1], and set K i,j = 1 if there exists a must-link between x i and x j and K i,j = 0 if there exists a cannot-link between x i and x j . Let us denote the modified kernel matrix by K ′ : This modification idea has been employed in spectral clustering [9] and demonstrated to be promising.

Semi-Supervised SMIC
Finally, we combine the above three ideas as When c > 2, we fix η at zero. This is the learning criterion of semi-supervised SMIC (3SMIC), whose global maximizer can be analytically obtained under orthonormality of {α y } c y=1 by the leading eigenvectors of U . Then the same post-processing as the original SMIC is applied and cluster assignments are obtained. Out-of-sample prediction is also possible in the same way as the original SMIC.

Tuning Parameter Optimization in 3SMIC
In the original SMIC, an SMI approximator called LSMI is used for tuning parameter optimization (see Appendix A). However, this is not suitable in semisupervised scenarios because the 3SMIC solution is biased to satisfy must-links and cannot-links. Here, we propose using max θ LSMI(θ) + Penalty(θ), where θ indicates tuning parameters in 3SMIC; in the experiments, γ, η, and the parameter t included in the kernel function K(x, x ′ ) is optimized. "Penalty" is the penalty for violating must-links and cannot-links, which is the only tuning factor in the proposed algorithm.

Experiments
In this section, we experimentally evaluate the performance of the proposed 3SMIC method in comparison with popular semi-supervised clustering methods: Spectral Learning (SL) [9] and Constrained Spectral Clustering (CSC) [24]. Both methods first perform semi-supervised spectral embedding and then k-means to obtain clustering results. However, we observed that the post k-means step is often unreliable, so we use simple thresholding [17] in the case of binary clustering for CSC.
In all experiments, we will use a sparse version of the local-scaling kernel [25] as the similarity measure: where N t (x) denotes the set of t nearest neighbors for x (t is the kernel parameter), σ i is a local scaling factor defined as , and x (t) i is the t-th nearest neighbor of x i . For SL and CSC, we test t = 1, 4, 7, 10 (note that there is no systematic way to choose the value of t), except for the spam dataset with t = 1 that caused numerical problems in the eigensolver when testing SL. On the other hand, in 3SMIC, we choose the value of t from {1, . . . , 10} based on the following criterion: where n v is the number of violated links. Here, both the LSMI value and the penalty are normalized so that they fall into the range [0, 1]. The γ and η parameters in 3SMIC are also chosen based on Eq.(9). We use the following real-world datasets: Must-links and cannot-links are generated from the true labels, by randomly sampling a couple of points and adding the corresponding 1 to the M or C matrices depending on the labels of the chosen pair of points. CSC is excluded from digits5k and spam because it needs to solve the complete eigenvalue problem and its computational cost was too high on these large datasets.
We evaluate the clustering performance by the Adjusted Rand Index (ARI) [8] between learned and true labels. Larger ARI values mean better clustering performance, and the zero ARI value means that the clustering result is equivalent to random. We investigate the ARI score as functions of the number of links used. Averages and standard deviations of ARI over 20 runs with different random seeds are plotted in Figure 1.
We can separate the datasets into two groups. For digits500, digits5k, and faces100, the baseline performances without links are reasonable; the introduction of links significantly increase the performance, bringing it around 0.9-0.95 from 0.5-0.8.
For parkinson, spam, and sonar where the baseline performances without links are poor, introduction of links quickly allow the clustering algorithms to find better solutions. In particular, only 3% of links (relative to all possible pairs) was sufficient for parkinson to achieve reasonable performance and surprisingly only 0.1% for spam.
As shown in Figure 1, the performance of SL depends heavily on the choice of t, but there is no systematic way to choose t for SL. It is important to notice that 3SMIC with t chosen systematically based on Eq.(9) performs as good as SL with t tuned optimally with hindsight. On the other hand, CSC performs rather stably for different values of t, and it works particularly well for binary problems with a small number of links. However, it performs very poorly for multi-class problems; we observed that the post k-means step is highly unreliable Fig. 1. Experimental results.
and poor local optimal solutions are often produced. For the binary problems, simply performing thresholding [17] instead of using k-means was found to be useful. However, there seems no simple alternatives in multi-class cases. The performance of CSC drops in parkinson and sonar when the number of links is increased, although such phenomena were not observed in SL and 3SMIC. Overall, the proposed 3SMIC method was shown to be a promising semisupervised clustering method.

Conclusions
In this paper, we proposed a novel information-maximization clustering method that can utilize side information provided as must-links and cannot-links. The proposed method, named semi-supervised SMI-based clustering (3SMIC), allows us to compute the clustering solution analytically. This is a strong advantage over conventional approaches such as constrained spectral clustering (CSC) that requires a post k-means step, because this post k-means step can be unreliable and cause significant performance degradation in practice. Furthermore, 3SMIC allows us to systematically determine tuning parameters such as the kernel width based on the information-maximization principle, given our reliance on the provided side information. Through experiments, we demonstrated that automatically-tuned 3SMIC perform as good as optimally-tuned spectral learning (SL) with hindsight.
The focus of our method in this paper was to inherit the analytical treatment of the original unsupervised SMIC in semi-supervised learning scenarios. Although this analytical treatment was demonstrated to be highly useful in experiments, our future work will explore more efficient use of must-links and cannot-links.
In the previous work [11], negative eigenvalues were found to contain useful information. Because must-link and cannot-link matrices can possess negative eigenvalues, it is interesting to investigate the role and effect of negative eigenvalues in the context of information-maximization clustering.

A Least-Squares Mutual Information
The solution of SMIC depends on the choice of the kernel parameter included in the kernel function K(x, x ′ ). Since SMIC was developed in the framework of SMI maximization, it would be natural to determine the kernel parameter so as to maximize SMI. A direct approach is to use the SMI estimator SMI given by Eq.(6) also for kernel parameter choice. However, this direct approach is not favorable because SMI is an unsupervised SMI estimator (i.e., SMI is estimated only from unlabeled samples {x i } n i=1 ). On the other hand, in the model selection stage, we have already obtained labeled samples {(x i , y i )} n i=1 , and thus supervised estimation of SMI is possible. For supervised SMI estimation, a nonparametric SMI estimator called least-squares mutual information (LSMI) [21] was proved to achieve the optimal convergence rate to the true SMI. Here we briefly review LSMI.
The key idea of LSMI is to learn the following density-ratio function [19], r * (x, y) := p * (x, y) p * (x)p * (y) , without going through probability density/mass estimation of p * (x, y), p * (x), and p * (y). More specifically, let us employ the following density-ratio model: r(x, y; ω) := ℓ:y ℓ =y ω ℓ L(x, x ℓ ), where ω = (ω 1 , . . . , ω n ) ⊤ and L(x, x ′ ) is a kernel function. In practice, we use the Gaussian kernel where the Gaussian width κ is the kernel parameter. To save the computation cost, we limit the number of kernel bases to 500 with randomly selected kernel centers. The parameter ω in the above density-ratio model is learned so that the following squared error is minimized: r(x, y; ω) − r * (x, y) 2 p * (x)p * (y)dx.
Let ω (y) be the parameter vector corresponding to the kernel bases {L(x, x ℓ )} ℓ:y ℓ =y , i.e., ω (y) is the sub-vector of ω = (ω 1 , . . . , ω n ) ⊤ consisting of indices {ℓ | y ℓ = y}. Let n y be the number of samples in class y, which is the same as the dimensionality of ω (y) . Then an empirical and regularized version of the optimization problem (11) is given for each y as follows: min ω (y) where δ (≥ 0) is the regularization parameter. H