Skip to content

Cluster assignments sometimes produces random numbers #165

@charliematteo

Description

@charliematteo

I realised that despite N_clusters is correctly identified, a few points are assigned as totally random integers, i.e. not between 0 (or -1) and N_clusters-1.

This happens if at the previous step I compute density PAk, not with kstarNN.

I suspect this is due to something in the cython_clustering.pyx. It looks like some points are left out of the assignment, so, since the cluster assignment array is initialised as an empty array
Last_cls = np.empty(Nele, dtype=int)
I think it just takes random values for those points. This is however just my hypothesis.

I attach a screenshot from my jupyter notebook.
The previous command is
d.compute_density_PAk()

d is an instance of the Clustering class: d = Clustering(X, maxk=200, verbose=True, period=periodicity)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions