# Methods for Cognitive Diagnosis of Students' Abilities Based on Keystroke Features
## 2 Related Works
### Research Method
#### 2.2.3 Evaluation Method  
The evaluation of the clustering effect is an important step. It helps in assessing the performance of clustering algorithms. Moreover, it plays a crucial role in analyzing the reliability and validity of the clustering results. According to the characteristics of the experimental dataset, internal evaluation indicators were chosen for evaluating the clustering effect in this study. It was not necessary to rely on external real label information. Such indicators usually evaluated the clustering effect in terms of two aspects: the compactness within clusters and the separation between clusters. 1. Silhouette Score  
The Silhouette Score is a commonly used internal evaluation indicator that comprehensively considers the compactness of a sample within the cluster and its separation from other clusters. The calculation formula of the Silhouette Score is given below:  
\[s(i)=\frac{b(i)-a(i)}{\max(a(i),b(i))}\quad\max_{i=1,\ldots,n}(s(i))=1\quad\min _{i=1,\ldots,n}(s(i))=-1 \tag{6}\]  
Here, \(i\) represents a sample, which, in this article, represents a candidate's keystroke data vector. \(a(i)\) represents the average distance from sample \(i\) to other samples in the same cluster, quantifying the cohesion within the cluster. The smaller \(a(i)\) is, the closer the samples within the cluster are. \(b(i)\) represents the average distance from sample \(i\) to all samples in the nearest other cluster, quantifying the separation between clusters. The larger \(b(i)\) is, the better the separation between clusters is. The value of the Silhouette Score ranges from \(-1\) to \(1\). The closer the value is to \(1\), the better the clustering effect is, that is, the samples within the cluster are closely clustered and there is a clear separation between clusters. The closer the value is to \(-1\), the more likely the sample is misclassified. When the value is close to \(0\), it means that the sample is at the boundary of two clusters and the clustering effect is poor. The Silhouette Score can consider both the compactness within clusters and the separation between clusters, comprehensively evaluate the clustering effect, and have good applicability to different clustering algorithms and datasets. 2. Calinski-Harabasz Index (CH index)  
The \(CH\) index is the ratio of the within-cluster dispersion to the between-cluster dispersion in clustering. The formula for calculating the \(CH\) index is as follows:  
\[CH=\frac{Tr(B_{k})}{Tr(W_{k})}\times\frac{n-k}{k-1} \tag{7}\]  
Here, \(Tr(B_{k})\) is the trace of the between-cluster dispersion matrix. This value reflects the degree of dispersion between clusters. \(Tr(W_{k})\) is the trace of the within-cluster dispersion matrix, and it reflects the degree of dispersion within clusters. \(n\) represents the total number of samples, and \(k\) is the number of clusters. The larger the \(CH\) index is, the greater the dispersion between clusters and the smaller the dispersion within clusters will be, that is, the better the clustering effect will be. The \(CH\) index can efficiently evaluate the clustering effect and exhibit a certain level of adaptability to different types of datasets. 3. Davies-Bouldin Index (DB index)  
The \(DB\) index is an evaluation indicator used to measure the similarity between clusters, and it assesses the clustering effect by calculating the ratio of the intra-cluster average distance to the inter-cluster distance. Its calculation formula is as follows:  
\[DB=\frac{1}{k}\sum_{i=1}^{k}\underset{i\
eq j}{\max}\frac{s_{i}+s_{j}}{d_{ij}} \tag{8}\]  
Here, \(s_{i}\) represents the average distance from samples to the center of the \(i\)-th cluster, that is, the average distance from samples to the cluster center. The smaller the value of \(s_{i}\) is, the more tightly the samples within the cluster are clustered. \(d_{ij}\) is the distance between the \(i\)-th and \(j\)-th clusters, usually computed as the distance between the cluster centers.