Computing Kappa Index
USAGE kappa=kappaindex(X,G,N)
X is a vector of length M (number of data samples). Each entry of X is associated with the cluster index for that sample
G is a vector in the same format of X belonging to ground truth indecies or a secondary clustering
N is the number of clusters
This measure only works when X and G have the same number of clusters. In addition, the set of indecies must be integers from one through the number of clusters.
However, they might be equivalent through a permutation of indecies
Example:
>> X=[1 1 2 2 3 3]; G=[2 2 1 1 3 3]; kappaindex(X,G,3)
ans = 1
>> X=[1 1 2 2 4 4 3]; G=[4 2 2 2 1 1 3]; kappaindex(X,G,4)
ans = 0.8056
Cite As
Hossein Mobahi (2026). Computing Kappa Index (https://www.mathworks.com/matlabcentral/fileexchange/22645-computing-kappa-index), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI and Statistics > Statistics and Machine Learning Toolbox > Cluster Analysis and Anomaly Detection >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
