kmeans_params.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025, 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 
20 
21 #include <raft/random/rng_state.hpp>
22 
23 #include <rapids_logger/logger.hpp>
24 
26 
27 struct params;
28 
29 } // end namespace cuvs::cluster::kmeans
30 
31 namespace ML::kmeans {
32 
33 struct KMeansParams {
36  int n_clusters = 8;
38  int max_iter = 300;
39  double tol = 1e-4;
40  rapids_logger::level_enum verbosity = rapids_logger::level_enum::info;
41  raft::random::RngState rng_state{0};
42  int n_init = 1;
43  double oversampling_factor = 2.0;
44  int batch_samples = 1 << 15;
45  int batch_centroids = 0;
46  bool inertia_check = false;
47 
48  cuvs::cluster::kmeans::params to_cuvs() const;
49 };
50 
51 } // end namespace ML::kmeans
DistanceType
Definition: distance_type.hpp:21
Definition: kmeans.hpp:27
Definition: kmeans_params.hpp:25
Definition: kmeans_params.hpp:33
bool inertia_check
Definition: kmeans_params.hpp:46
int n_init
Definition: kmeans_params.hpp:42
int batch_samples
Definition: kmeans_params.hpp:44
double oversampling_factor
Definition: kmeans_params.hpp:43
int n_clusters
Definition: kmeans_params.hpp:36
ML::distance::DistanceType metric
Definition: kmeans_params.hpp:35
double tol
Definition: kmeans_params.hpp:39
InitMethod
Definition: kmeans_params.hpp:34
raft::random::RngState rng_state
Definition: kmeans_params.hpp:41
InitMethod init
Definition: kmeans_params.hpp:37
int batch_centroids
Definition: kmeans_params.hpp:45
cuvs::cluster::kmeans::params to_cuvs() const
Definition: kmeans_params.cpp:24
int max_iter
Definition: kmeans_params.hpp:38
rapids_logger::level_enum verbosity
Definition: kmeans_params.hpp:40