[Python] Scikit dendrogram: How to disable ouput?

Discussão em 'Python' iniciado por Stack, Fevereiro 3, 2025.

  1. Stack

    Stack Membro Participativo

    If I run dendrogram from the scikit libary:

    from scipy.cluster.hierarchy import linkage, dendrogram
    # ...
    X = np.asarray(X)
    Z = linkage(X, 'single', 'correlation')
    plt.figure(figsize=(16,8))
    dendrogram(Z, color_threshold=0.7)


    I get a ton of print output in my ipython notebook:

    {'color_list': ['g',
    'r',
    'c',
    'm',
    'y',
    ...
    0.70780175324891315,
    0.70172263980890581],
    [0.0, 0.54342622932769225, 0.54342622932769225, 0.0],
    [0.0, 0.46484932243120658, 0.46484932243120658, 0.0],
    ...
    177,
    196,
    82,
    19,
    108]}


    How can I disable this? I'm only interested in the actual dendrogram.

    Continue reading...

Compartilhe esta Página