I am new to clustering and am a bit confused on how the following code can compute centroid information without the original euclidean vectors.
import numpy as np
from scipy.cluster import hierarchy
import matplotlib.pyplot as plt
# Create an array of distances
x = np.array([100., 200., 300., 400., 500., 250.,
450., 280., 450., 750.])
# compute linkage
temp = hierarchy.linkage(x, method="centroid")
This code runs without error and is using 'centroid' as the link method. I am confused as to how this is even possible. My guess is there might be a formula which maps distance pair values to the centroid distance value.
I tried looking at various sources, including scipy documentation, but they all mention taking on average of the original data. Is there some reference which discusses how one can compute centroid distances without the original euclidean data?