umapparams.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2024, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cuml/common/callback.hpp>
20 #include <cuml/common/logger.hpp>
21 
22 #include <raft/distance/distance_types.hpp>
23 #include <raft/neighbors/nn_descent_types.hpp>
24 
25 namespace ML {
26 
27 using nn_index_params = raft::neighbors::experimental::nn_descent::index_params;
28 
29 class UMAPParams {
30  public:
33 
40  int n_neighbors = 15;
41 
45  int n_components = 2;
46 
51  int n_epochs = 0;
52 
56  float learning_rate = 1.0;
57 
66  float min_dist = 0.1;
67 
72  float spread = 1.0;
73 
82  float set_op_mix_ratio = 1.0;
83 
91  float local_connectivity = 1.0;
92 
98  float repulsion_strength = 1.0;
99 
107 
114  float transform_queue_size = 4.0;
115 
120 
126  float a = -1.0;
127 
133  float b = -1.0;
134 
138  float initial_alpha = 1.0;
139 
145  int init = 1;
146 
150  graph_build_algo build_algo = graph_build_algo::BRUTE_FORCE_KNN;
151 
153 
159 
161 
162  float target_weight = 0.5;
163 
164  uint64_t random_state = 0;
165 
171  bool deterministic = true;
172 
173  raft::distance::DistanceType metric = raft::distance::DistanceType::L2SqrtExpanded;
174 
175  float p = 2.0;
176 
178 };
179 
180 } // namespace ML
Definition: callback.hpp:29
Definition: umapparams.h:29
bool deterministic
Definition: umapparams.h:171
graph_build_algo
Definition: umapparams.h:32
@ BRUTE_FORCE_KNN
Definition: umapparams.h:32
@ NN_DESCENT
Definition: umapparams.h:32
float min_dist
Definition: umapparams.h:66
float repulsion_strength
Definition: umapparams.h:98
float local_connectivity
Definition: umapparams.h:91
float set_op_mix_ratio
Definition: umapparams.h:82
float initial_alpha
Definition: umapparams.h:138
float target_weight
Definition: umapparams.h:162
float spread
Definition: umapparams.h:72
raft::distance::DistanceType metric
Definition: umapparams.h:173
float a
Definition: umapparams.h:126
int n_components
Definition: umapparams.h:45
int n_neighbors
Definition: umapparams.h:40
float transform_queue_size
Definition: umapparams.h:114
MetricType target_metric
Definition: umapparams.h:160
float p
Definition: umapparams.h:175
graph_build_algo build_algo
Definition: umapparams.h:150
int negative_sample_rate
Definition: umapparams.h:106
nn_index_params nn_descent_params
Definition: umapparams.h:152
float b
Definition: umapparams.h:133
int n_epochs
Definition: umapparams.h:51
int verbosity
Definition: umapparams.h:119
int init
Definition: umapparams.h:145
MetricType
Definition: umapparams.h:31
@ EUCLIDEAN
Definition: umapparams.h:31
@ CATEGORICAL
Definition: umapparams.h:31
Internals::GraphBasedDimRedCallback * callback
Definition: umapparams.h:177
uint64_t random_state
Definition: umapparams.h:164
float learning_rate
Definition: umapparams.h:56
int target_n_neighbors
Definition: umapparams.h:158
#define CUML_LEVEL_INFO
Definition: log_levels.hpp:28
Definition: dbscan.hpp:30
raft::neighbors::experimental::nn_descent::index_params nn_index_params
Definition: umapparams.h:27