Skip to content

[NO MERGE] Putting data on host for HDBSCAN using mst optimize #6044

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

Draft
wants to merge 1 commit into
base: branch-24.10
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions cpp/include/cuml/cluster/hdbscan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <raft/core/handle.hpp>
#include <raft/distance/distance_types.hpp>
#include <raft/neighbors/nn_descent_types.hpp>

#include <rmm/device_uvector.hpp>

Expand All @@ -27,6 +28,8 @@ namespace ML {
namespace HDBSCAN {
namespace Common {

using nn_index_params = raft::neighbors::experimental::nn_descent::index_params;

/**
* The Condensed hierarchicy is represented by an edge list with
* parents as the source vertices, children as the destination,
Expand Down Expand Up @@ -134,6 +137,7 @@ class CondensedHierarchy {
};

enum CLUSTER_SELECTION_METHOD { EOM = 0, LEAF = 1 };
enum GRAPH_BUILD_ALGO { BRUTE_FORCE_KNN = 0, NN_DESCENT = 1 };

class RobustSingleLinkageParams {
public:
Expand All @@ -151,6 +155,8 @@ class RobustSingleLinkageParams {
class HDBSCANParams : public RobustSingleLinkageParams {
public:
CLUSTER_SELECTION_METHOD cluster_selection_method = CLUSTER_SELECTION_METHOD::EOM;
GRAPH_BUILD_ALGO build_algo = GRAPH_BUILD_ALGO::BRUTE_FORCE_KNN;
nn_index_params nn_descent_params = {};
};

/**
Expand Down Expand Up @@ -495,14 +501,19 @@ namespace HDBSCAN::HELPER {
* @param n number of columns in X
* @param metric distance metric to use
* @param min_samples minimum number of samples to use for computing core distances
* @param build_algo build algo for building the knn graph (default: brute_force_knn)
* @param build_params build parameters for build_algo
*/
void compute_core_dists(const raft::handle_t& handle,
const float* X,
float* core_dists,
size_t m,
size_t n,
raft::distance::DistanceType metric,
int min_samples);
void compute_core_dists(
const raft::handle_t& handle,
const float* X,
float* core_dists,
size_t m,
size_t n,
raft::distance::DistanceType metric,
int min_samples,
HDBSCAN::Common::GRAPH_BUILD_ALGO build_algo = HDBSCAN::Common::GRAPH_BUILD_ALGO::BRUTE_FORCE_KNN,
HDBSCAN::Common::nn_index_params build_params = Common::nn_index_params{});

/**
* @brief Compute the map from final, normalize labels to the labels in the CondensedHierarchy
Expand Down
Loading
Loading