cd_mg.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-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 
20 
21 #include <cumlprims/opg/matrix/data.hpp>
22 #include <cumlprims/opg/matrix/part_descriptor.hpp>
23 
24 namespace ML {
25 namespace CD {
26 namespace opg {
27 
45 void fit(raft::handle_t& handle,
46  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
47  MLCommon::Matrix::PartDescriptor& input_desc,
48  std::vector<MLCommon::Matrix::Data<float>*>& labels,
49  float* coef,
50  float* intercept,
51  bool fit_intercept,
52  bool normalize,
53  int epochs,
54  float alpha,
55  float l1_ratio,
56  bool shuffle,
57  float tol,
58  bool verbose);
59 
60 void fit(raft::handle_t& handle,
61  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
62  MLCommon::Matrix::PartDescriptor& input_desc,
63  std::vector<MLCommon::Matrix::Data<double>*>& labels,
64  double* coef,
65  double* intercept,
66  bool fit_intercept,
67  bool normalize,
68  int epochs,
69  double alpha,
70  double l1_ratio,
71  bool shuffle,
72  double tol,
73  bool verbose);
74 
88 void predict(raft::handle_t& handle,
89  MLCommon::Matrix::RankSizePair** rank_sizes,
90  size_t n_parts,
91  MLCommon::Matrix::Data<float>** input,
92  size_t n_rows,
93  size_t n_cols,
94  float* coef,
95  float intercept,
96  MLCommon::Matrix::Data<float>** preds,
97  bool verbose);
98 
99 void predict(raft::handle_t& handle,
100  MLCommon::Matrix::RankSizePair** rank_sizes,
101  size_t n_parts,
102  MLCommon::Matrix::Data<double>** input,
103  size_t n_rows,
104  size_t n_cols,
105  double* coef,
106  double intercept,
107  MLCommon::Matrix::Data<double>** preds,
108  bool verbose);
109 
110 }; // end namespace opg
111 }; // namespace CD
112 }; // 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
void 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:194
void shuffle(std::vector< math_t > &rand_indices, std::mt19937 &g)
Definition: shuffle.h:35
Definition: dbscan.hpp:30