cd_mg.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
9 
10 #include <cumlprims/opg/matrix/data.hpp>
11 #include <cumlprims/opg/matrix/part_descriptor.hpp>
12 
13 namespace ML {
14 namespace CD {
15 namespace opg {
16 
35 int fit(raft::handle_t& handle,
36  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
37  MLCommon::Matrix::PartDescriptor& input_desc,
38  std::vector<MLCommon::Matrix::Data<float>*>& labels,
39  float* coef,
40  float* intercept,
41  bool fit_intercept,
42  bool normalize,
43  int epochs,
44  float alpha,
45  float l1_ratio,
46  bool shuffle,
47  float tol,
48  bool verbose);
49 
50 int fit(raft::handle_t& handle,
51  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
52  MLCommon::Matrix::PartDescriptor& input_desc,
53  std::vector<MLCommon::Matrix::Data<double>*>& labels,
54  double* coef,
55  double* intercept,
56  bool fit_intercept,
57  bool normalize,
58  int epochs,
59  double alpha,
60  double l1_ratio,
61  bool shuffle,
62  double tol,
63  bool verbose);
64 
78 void predict(raft::handle_t& handle,
79  MLCommon::Matrix::RankSizePair** rank_sizes,
80  size_t n_parts,
81  MLCommon::Matrix::Data<float>** input,
82  size_t n_rows,
83  size_t n_cols,
84  float* coef,
85  float intercept,
86  MLCommon::Matrix::Data<float>** preds,
87  bool verbose);
88 
89 void predict(raft::handle_t& handle,
90  MLCommon::Matrix::RankSizePair** rank_sizes,
91  size_t n_parts,
92  MLCommon::Matrix::Data<double>** input,
93  size_t n_rows,
94  size_t n_cols,
95  double* coef,
96  double intercept,
97  MLCommon::Matrix::Data<double>** preds,
98  bool verbose);
99 
100 }; // end namespace opg
101 }; // namespace CD
102 }; // end namespace ML
void predict(raft::handle_t &handle, MLCommon::Matrix::RankSizePair **rank_sizes, size_t n_parts, MLCommon::Matrix::Data< float > **input, size_t n_rows, size_t n_cols, float *coef, float intercept, MLCommon::Matrix::Data< float > **preds, bool verbose)
performs MNMG prediction for OLS
int fit(raft::handle_t &handle, std::vector< MLCommon::Matrix::Data< float > * > &input_data, MLCommon::Matrix::PartDescriptor &input_desc, std::vector< MLCommon::Matrix::Data< float > * > &labels, float *coef, float *intercept, bool fit_intercept, bool normalize, int epochs, float alpha, float l1_ratio, bool shuffle, float tol, bool verbose)
performs MNMG fit operation for the ridge regression
void normalize(value_t *data, value_idx n, size_t m, cudaStream_t stream)
Definition: utils.h:177
void shuffle(std::vector< math_t > &rand_indices, std::mt19937 &g)
Definition: shuffle.h:24
Definition: dbscan.hpp:18