Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.deeplearning4j.clustering.cluster.ClusterSet#getMostPopulatedClusters returns the least populated clusters #8383

Closed
chentao106 opened this issue Nov 12, 2019 · 1 comment

Comments

@chentao106
Copy link

@chentao106 chentao106 commented Nov 12, 2019

Issue Description

Please describe our issue, along with:

  • expected behavior
    org.deeplearning4j.clustering.cluster.ClusterSet#getMostPopulatedClusters should returns the top N clusters that has most points.
  • encountered behavior
    getMostPopulatedClusters returns the top N clusters that least points.

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j version: Both 1.0.0-beta3 to 1.0.0-beta5, b5f0ec0(current master)
  • Platform information (OS, etc): Windows 10
  • CUDA version, if used: None
  • NVIDIA driver version, if in use: None

Additional Information

Where applicable, please also provide:

  • Full log or exception stack trace (ideally in a Gist: gist.github.com)
  • pom.xml file or similar (also in a Gist)

Contributing

If you'd like to help us fix the issue by contributing some code, but would
like guidance or help in doing so, please mention it!
'''java
public List getMostPopulatedClusters(int count) {
List mostPopulated = new ArrayList<>(clusters);
Collections.sort(mostPopulated, new Comparator() {
public int compare(Cluster o1, Cluster o2) {
return new Integer(o1.getPoints().size()).compareTo(new Integer(o2.getPoints().size()));
}
});
return mostPopulated.subList(0, count);
}
'''
Should be change to:
'''java
public List getMostPopulatedClusters(int count) {
List mostPopulated = new ArrayList<>(clusters);
Collections.sort(mostPopulated, new Comparator() {
public int compare(Cluster o1, Cluster o2) {
return Integer.compare(o2.getPoints().size(), o1.getPoints().size());
}
});
return mostPopulated.subList(0, count);
}
'''

@AlexDBlack

This comment has been minimized.

Copy link
Contributor

@AlexDBlack AlexDBlack commented Dec 5, 2019

@AlexDBlack AlexDBlack closed this Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.