genetic.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include "common.h"
9 #include "program.h"
10 
11 #include <raft/core/handle.hpp>
12 
13 namespace cuml {
14 namespace genetic {
15 
22 std::string stringify(const program& prog);
23 
47 void symFit(const raft::handle_t& handle,
48  const float* input,
49  const float* labels,
50  const float* sample_weights,
51  const int n_rows,
52  const int n_cols,
53  param& params,
54  program_t& final_progs,
55  std::vector<std::vector<program>>& history);
56 
66 void symRegPredict(const raft::handle_t& handle,
67  const float* input,
68  const int n_rows,
69  const program_t& best_prog,
70  float* output);
71 
83 void symClfPredictProbs(const raft::handle_t& handle,
84  const float* input,
85  const int n_rows,
86  const param& params,
87  const program_t& best_prog,
88  float* output);
89 
100 void symClfPredict(const raft::handle_t& handle,
101  const float* input,
102  const int n_rows,
103  const param& params,
104  const program_t& best_prog,
105  float* output);
106 
118 void symTransform(const raft::handle_t& handle,
119  const float* input,
120  const param& params,
121  const program_t& final_progs,
122  const int n_rows,
123  const int n_cols,
124  float* output);
125 
126 } // namespace genetic
127 } // namespace cuml
std::string stringify(const program &prog)
Visualize an AST.
void symTransform(const raft::handle_t &handle, const float *input, const param ¶ms, 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 ¶ms, 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 ¶ms, 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 ¶ms, 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:15
contains all the hyper-parameters for training
Definition: common.h:83
The main data structure to store the AST that represents a program in the current generation.
Definition: program.h:21