[scikit-learn] Using text labels in dendrogram
mahmood.nt at gmail.com
Tue Dec 15 01:36:57 EST 2020
OK. As I checked the documents, I have to fix the labelList line to the
string that I want.
On Mon, Dec 14, 2020 at 5:31 PM Mahmood Naderan <mahmood.nt at gmail.com>
> I use the following code to create a dendrogram from a set of x-y points
> import matplotlib.pyplot as plt
> import numpy as np
> from scipy.cluster.hierarchy import dendrogram, linkage
> a = np.array([
> linked = linkage(a, 'single')
> labelList = range(1, 69)
> This code automatically assigns labels for the points and the result is
> not sorted. For example, the x-axis labels are 2 1 3.
> I want to assign a text for each point. Then no matter where the point
> goes, I can see the text that I have assigned. For example, I want to see
> PDD, XDD, BDD.
> How can I create a list of text labels and bind that to the array a?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the scikit-learn