Belemnogo
Belemnogo

Reputation: 33

Get cluster members/elements clustering with scikit-learn DBSCAN

I use dbscan scikit-learn algorithm for clustering. db = DBSCAN().fit(X) returns me 8 for example. My goal is to recover the cluster by cluster components. I said that X is a vector to vector and what I expect when I speak of cluster members, it is the sub-vectors of X. Is there anyone to help me?

Upvotes: 3

Views: 5628

Answers (1)

aberger
aberger

Reputation: 2397

I believe you are asking for the cluster assignment of each item in your dataset, X.

You can use the labels_ attribute. db.labels_ Each index here corresponds to the same index in X, so you can see the assignments.

Upvotes: 5

Related Questions