This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.preprocessing import LabelEncoder | |
DIAMETER_METHODS = ['mean_cluster', 'farthest'] | |
CLUSTER_DISTANCE_METHODS = ['nearest', 'farthest'] | |
def inter_cluster_distances(labels, distances, method='nearest'): | |
"""Calculates the distances between the two nearest points of each cluster. |