genetic.h
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 "common.h"
20 #include "program.h"
21 
22 #include <raft/core/handle.hpp>
23 
24 namespace cuml {
25 namespace genetic {
26 
33 std::string stringify(const program& prog);
34 
58 void symFit(const raft::handle_t& handle,
59  const float* input,
60  const float* labels,
61  const float* sample_weights,
62  const int n_rows,
63  const int n_cols,
64  param& params,
65  program_t& final_progs,
66  std::vector<std::vector<program>>& history);
67 
77 void symRegPredict(const raft::handle_t& handle,
78  const float* input,
79  const int n_rows,
80  const program_t& best_prog,
81  float* output);
82 
94 void symClfPredictProbs(const raft::handle_t& handle,
95  const float* input,
96  const int n_rows,
97  const param& params,
98  const program_t& best_prog,
99  float* output);
100 
111 void symClfPredict(const raft::handle_t& handle,
112  const float* input,
113  const int n_rows,
114  const param& params,
115  const program_t& best_prog,
116  float* output);
117 
129 void symTransform(const raft::handle_t& handle,
130  const float* input,
131  const param& params,
132  const program_t& final_progs,
133  const int n_rows,
134  const int n_cols,
135  float* output);
136 
137 } // namespace genetic
138 } // namespace cuml
std::string stringify(const program &prog)
Visualize an AST.
void symTransform(const raft::handle_t &handle, const float *input, const param &params, const program_t &final_progs, const int n_rows, const int n_cols, float *output)
Transform the values in the input feature matrix according to the supplied programs.
void symClfPredictProbs(const raft::handle_t &handle, const float *input, const int n_rows, const param &params, const program_t &best_prog, float *output)
Probability prediction for a symbolic classifier. If a transformer(like sigmoid) is specified,...
void symRegPredict(const raft::handle_t &handle, const float *input, const int n_rows, const program_t &best_prog, float *output)
Make predictions for a symbolic regressor.
void symClfPredict(const raft::handle_t &handle, const float *input, const int n_rows, const param &params, const program_t &best_prog, float *output)
Return predictions for a binary classification program defining the decision boundary.
void symFit(const raft::handle_t &handle, const float *input, const float *labels, const float *sample_weights, const int n_rows, const int n_cols, param &params, program_t &final_progs, std::vector< std::vector< program >> &history)
Fit either a regressor, classifier or a transformer to the given dataset.
Definition: common.h:26
contains all the hyper-parameters for training
Definition: common.h:94
The main data structure to store the AST that represents a program in the current generation.
Definition: program.h:32