[Python] Determine in which cluster goes a new element with scipy linkage

Discussão em 'Python' iniciado por Stack, Novembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I have the following program where data is a pandas.DataFrame:

    from scipy.cluster.hierarchy import linkage

    Z = linkage(data, method='ward', metric='euclidean')
    clusters = fcluster(Z, 2, criterion='maxclust')


    Now, considering a set of new elements that have the same structure as data, how do i know which cluster do they belong to?

    Continue reading...

Compartilhe esta Página