Cluster Validation (Similarity)

  1. Read Data:

    Read the input data points from the "sample_input" file.

  2. Define Jaccard Similarity Function:

    Define a function to calculate the Jaccard similarity between two sets of labels.

  3. Define Normalized Mutual Information (NMI) Function:

    Define a function to calculate the Normalized Mutual Information between two sets of labels.

  4. Parse Data:

    Parse the input data and extract cluster labels and predicted labels.

  5. Calculate Similarity:

    Calculate both Jaccard similarity and NMI similarity between the cluster labels and predicted labels.

Code