ridge_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 
19 #include "glm.hpp"
20 
21 #include <cumlprims/opg/matrix/data.hpp>
22 #include <cumlprims/opg/matrix/part_descriptor.hpp>
23 
24 namespace ML {
25 namespace Ridge {
26 namespace opg {
27 
43 void fit(raft::handle_t& handle,
44  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
45  MLCommon::Matrix::PartDescriptor& input_desc,
46  std::vector<MLCommon::Matrix::Data<float>*>& labels,
47  float* alpha,
48  int n_alpha,
49  float* coef,
50  float* intercept,
51  bool fit_intercept,
52  bool normalize,
53  int algo,
54  bool verbose);
55 
56 void fit(raft::handle_t& handle,
57  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
58  MLCommon::Matrix::PartDescriptor& input_desc,
59  std::vector<MLCommon::Matrix::Data<double>*>& labels,
60  double* alpha,
61  int n_alpha,
62  double* coef,
63  double* intercept,
64  bool fit_intercept,
65  bool normalize,
66  int algo,
67  bool verbose);
68 
82 void predict(raft::handle_t& handle,
83  MLCommon::Matrix::RankSizePair** rank_sizes,
84  size_t n_parts,
85  MLCommon::Matrix::Data<float>** input,
86  size_t n_rows,
87  size_t n_cols,
88  float* coef,
89  float intercept,
90  MLCommon::Matrix::Data<float>** preds,
91  bool verbose);
92 
93 void predict(raft::handle_t& handle,
94  MLCommon::Matrix::RankSizePair** rank_sizes,
95  size_t n_parts,
96  MLCommon::Matrix::Data<double>** input,
97  size_t n_rows,
98  size_t n_cols,
99  double* coef,
100  double intercept,
101  MLCommon::Matrix::Data<double>** preds,
102  bool verbose);
103 
104 }; // end namespace opg
105 }; // end namespace Ridge
106 }; // end namespace ML
void normalize(value_t *data, value_idx n, size_t m, cudaStream_t stream)
Definition: utils.h:194
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 *alpha, int n_alpha, float *coef, float *intercept, bool fit_intercept, bool normalize, int algo, bool verbose)
performs MNMG fit operation for the ridge regression
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
Definition: dbscan.hpp:30