# Analysis of University Students' Behavior Based on a Fusion K-Means Clustering Algorithm
## 2 Materials and Methods
### K-CFSFDP Algorithm  
Based on the way of determining the k value and cluster center, the K-CFSFDP algorithm was proposed, which mainly includes the following steps:  
Step 1: Data process: data normalization:  
We first used formula (1) to standardize the data. This step was implemented in the data preprocessing section.  
Step 2: Calculate the density of each point:  
The clustering set was \(\text{S}=\{x_{i}\}\)\(\begin{array}{c}N\\ i=1\end{array}\). We adopted the Gaussian kernel function to calculate the density. The formula is as follows:  
\[\rho_{i}=\sum_{j\in I_{S_{i}\backslash\{i\}}}e^{-(\frac{d_{ij}}{\chi})^{2}} \tag{11}\]  
\(I_{S}=\{1,2,\ldots,N\}\) is an indicator set. \(d_{ij}=dist(x_{i},\,x_{j})\) represents the Euclidean distance between points \(x_{i}\) and \(x_{j}\).  
Step 3: Calculate the distance value for each point:  
* Distance formula between points and points adopted the Euclidean distance as shown in formula (4). The \(d_{ij}\) was calculated and was \(d_{ij}=d_{ji},i<j,i,j\in I_{S}\).
* According to \(\{\rho_{i}\}_{i=1}^{N}\), we generated its descending order subscript \(\{q_{i}\}_{i=1}^{N}\).
* We calculated the distance value \(\{\delta_{i}\}_{i=1}^{N}\).  
Step 4: Calculate the \(\gamma\) value:  
Based on \(\{\rho_{i}\}_{i=1}^{N}\) and \(\{\delta_{i}\}_{i=1}^{N}\), \(\{\gamma_{i}\}_{i=1}^{N}\) was calculated. The magnitude of \(\{\rho_{i}\}_{i=1}^{N}\) and \(\{\delta_{i}\}_{i=1}^{N}\) might be different. If the difference is too large, it's necessary to perform a normalization process.  
Step 5: Determine the k value and the cluster center:  
We selected the number of cluster (k value) and cluster center according to the decision graph and initialized the data point classification attribute tag \(\{c_{i}\}_{i=1}^{N}\), as follows:  
\[c_{i}=\left\{\begin{array}{ll}t,\,t\epsilon[1,k],&\text{if $x_{i}$ is the cluster center and belongs to the first k cluster}\\ -1,&\text{other}\end{array}\right. \tag{12}\]  
Step 6: Use Euclidean distances to classify other points (formula 4):  
For data points that were not cluster centers (\(c_{i}=-1\)), we calculated the Euclidean distance between the data point and each cluster center, selected the cluster center with the shortest distance, and classified the data point into the category to which the cluster center belongs.  
Compared with CFSFDP, K-CFSFDP has achieved improvements in the following aspects:  
1. K-CFSFDP used Gaussian kernel instead of the original cut-off kernel in CFSFDP. Cut-off kernel is a discrete value while Gaussian kernel is a continuous value. Therefore, the Gaussian kernel has a smaller probability of conflict (i.e., different data points have the same local density value). In addition, the Gaussian kernel still satisfies that the more data points whose distance from \(x_{i}\) is less than \(d_{c}\), the greater the value of \(\rho_{i}\).
2. We clarified the measurement method of data point distance in K-CFSFDP.
2. Using the determined number of clusters and cluster centers, this study optimized the classification of other data points. Each data point only needs to traverse the Euclidean distance to each cluster center to find the nearest cluster, without additional calculations to the distance of other non-cluster center data points. This greatly reduces the computational complexity of the algorithm. Assigning data points to the cluster center closest to it can spend less time to improve efficiency.  
Compared to the original K-Means algorithm, the advantages of the K-CFSFDP algorithm is that the algorithm can automatically select the appropriate number of classes and initial cluster center based on the characteristics of the data. This can reduce human involvement in clustering.