pca_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 "pca.hpp"
20 
21 #include <cumlprims/opg/matrix/data.hpp>
22 #include <cumlprims/opg/matrix/part_descriptor.hpp>
23 
24 namespace ML {
25 namespace PCA {
26 namespace opg {
27 
42 void fit(raft::handle_t& handle,
43  std::vector<MLCommon::Matrix::Data<float>*>& input_data,
44  MLCommon::Matrix::PartDescriptor& input_desc,
45  float* components,
46  float* explained_var,
47  float* explained_var_ratio,
48  float* singular_vals,
49  float* mu,
50  float* noise_vars,
51  paramsPCAMG prms,
52  bool verbose = false);
53 
54 void fit(raft::handle_t& handle,
55  std::vector<MLCommon::Matrix::Data<double>*>& input_data,
56  MLCommon::Matrix::PartDescriptor& input_desc,
57  double* components,
58  double* explained_var,
59  double* explained_var_ratio,
60  double* singular_vals,
61  double* mu,
62  double* noise_vars,
63  paramsPCAMG prms,
64  bool verbose = false);
65 
82 void fit_transform(raft::handle_t& handle,
83  MLCommon::Matrix::RankSizePair** rank_sizes,
84  std::uint32_t n_parts,
85  MLCommon::Matrix::floatData_t** input,
86  MLCommon::Matrix::floatData_t** trans_input,
87  float* components,
88  float* explained_var,
89  float* explained_var_ratio,
90  float* singular_vals,
91  float* mu,
92  float* noise_vars,
93  paramsPCAMG prms,
94  bool verbose);
95 
96 void fit_transform(raft::handle_t& handle,
97  MLCommon::Matrix::RankSizePair** rank_sizes,
98  std::uint32_t n_parts,
99  MLCommon::Matrix::doubleData_t** input,
100  MLCommon::Matrix::doubleData_t** trans_input,
101  double* components,
102  double* explained_var,
103  double* explained_var_ratio,
104  double* singular_vals,
105  double* mu,
106  double* noise_vars,
107  paramsPCAMG prms,
108  bool verbose);
109 
123 void transform(raft::handle_t& handle,
124  MLCommon::Matrix::RankSizePair** rank_sizes,
125  std::uint32_t n_parts,
126  MLCommon::Matrix::Data<float>** input,
127  float* components,
128  MLCommon::Matrix::Data<float>** trans_input,
129  float* singular_vals,
130  float* mu,
131  paramsPCAMG prms,
132  bool verbose);
133 
134 void transform(raft::handle_t& handle,
135  MLCommon::Matrix::RankSizePair** rank_sizes,
136  std::uint32_t n_parts,
137  MLCommon::Matrix::Data<double>** input,
138  double* components,
139  MLCommon::Matrix::Data<double>** trans_input,
140  double* singular_vals,
141  double* mu,
142  paramsPCAMG prms,
143  bool verbose);
144 
158 void inverse_transform(raft::handle_t& handle,
159  MLCommon::Matrix::RankSizePair** rank_sizes,
160  std::uint32_t n_parts,
161  MLCommon::Matrix::Data<float>** trans_input,
162  float* components,
163  MLCommon::Matrix::Data<float>** input,
164  float* singular_vals,
165  float* mu,
166  paramsPCAMG prms,
167  bool verbose);
168 
169 void inverse_transform(raft::handle_t& handle,
170  MLCommon::Matrix::RankSizePair** rank_sizes,
171  std::uint32_t n_parts,
172  MLCommon::Matrix::Data<double>** trans_input,
173  double* components,
174  MLCommon::Matrix::Data<double>** input,
175  double* singular_vals,
176  double* mu,
177  paramsPCAMG prms,
178  bool verbose);
179 
180 }; // end namespace opg
181 }; // end namespace PCA
182 }; // end namespace ML
structure for pca parameters. Ref: http://scikit-learn.org/stable/modules/generated/sklearn....
Definition: params.hpp:75
void inverse_transform(raft::handle_t &handle, MLCommon::Matrix::RankSizePair **rank_sizes, std::uint32_t n_parts, MLCommon::Matrix::Data< float > **trans_input, float *components, MLCommon::Matrix::Data< float > **input, float *singular_vals, float *mu, paramsPCAMG prms, bool verbose)
performs MNMG inverse transform operation for the pca
void fit_transform(raft::handle_t &handle, MLCommon::Matrix::RankSizePair **rank_sizes, std::uint32_t n_parts, MLCommon::Matrix::floatData_t **input, MLCommon::Matrix::floatData_t **trans_input, float *components, float *explained_var, float *explained_var_ratio, float *singular_vals, float *mu, float *noise_vars, paramsPCAMG prms, bool verbose)
performs MNMG fit and transform operation for the pca
void transform(raft::handle_t &handle, MLCommon::Matrix::RankSizePair **rank_sizes, std::uint32_t n_parts, MLCommon::Matrix::Data< float > **input, float *components, MLCommon::Matrix::Data< float > **trans_input, float *singular_vals, float *mu, paramsPCAMG prms, bool verbose)
performs MNMG transform operation for the pca
void fit(raft::handle_t &handle, std::vector< MLCommon::Matrix::Data< float > * > &input_data, MLCommon::Matrix::PartDescriptor &input_desc, float *components, float *explained_var, float *explained_var_ratio, float *singular_vals, float *mu, float *noise_vars, paramsPCAMG prms, bool verbose=false)
performs MNMG fit operation for the pca
Definition: dbscan.hpp:30
@ PCA
Definition: tsne.h:31