Brush C++ API
A flexible interpretable machine learning framework
|
The Engine
class represents the core engine of the brush library.
More...
#include <engine.h>
Public Attributes | |
float | best_score |
int | best_complexity |
Parameters | params |
hyperparameters of brush, which the user can interact | |
Individual< T > | best_ind |
Archive< T > | archive |
pareto front archive | |
Private Member Functions | |
void | init () |
initialize Feat object for fitting. | |
void | set_is_fitted (bool f) |
set flag indicating whether fit has been called | |
Private Attributes | |
SearchSpace | ss |
Population< T > | pop |
population of programs | |
Selection< T > | selector |
selection algorithm | |
Evaluation< T > | evaluator |
evaluation code | |
Variation< T > | variator |
variation operators | |
Selection< T > | survivor |
survival algorithm | |
Log_Stats | stats |
runtime stats | |
Timer | timer |
start time of training | |
bool | is_fitted |
keeps track of whether fit was called. | |
The Engine
class represents the core engine of the brush library.
It encapsulates the functionality for training and predicting with programs in a genetic programming framework. The Engine
class manages the population of programs, selection algorithms, evaluation code, variation operators, and survival algorithms. It also provides methods for training the model, making predictions, and accessing runtime statistics.
The Engine
class is parameterized by the program type T
, which determines the type of programs that can be evolved and evaluated by the engine.
|
inline |
|
inline |
void Brush::Engine< T >::calculate_stats | ( | ) |
|
inline |
|
inline |
vector< json > Brush::Engine< T >::get_archive | ( | bool | front | ) |
return population as string
Definition at line 191 of file engine.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
initialize Feat object for fitting.
Definition at line 18 of file engine.cpp.
void Brush::Engine< T >::log_stats | ( | std::ofstream & | log | ) |
|
inline |
|
inline |
auto Brush::Engine< T >::predict_archive | ( | int | id, |
const Dataset & | data ) |
predict on unseen data from the archive
Definition at line 208 of file engine.cpp.
auto Brush::Engine< T >::predict_archive | ( | int | id, |
const Ref< const ArrayXXf > & | X ) |
|
inline |
|
inline |
auto Brush::Engine< T >::predict_proba_archive | ( | int | id, |
const Dataset & | data ) |
void Brush::Engine< T >::print_progress | ( | float | percentage | ) |
void Brush::Engine< T >::print_stats | ( | std::ofstream & | log, |
float | fraction ) |
void Brush::Engine< T >::run | ( | Dataset & | d | ) |
train the model
Definition at line 324 of file engine.cpp.
|
inlineprivate |
|
inline |
bool Brush::Engine< T >::update_best | ( | const Dataset & | data, |
bool | val = false ) |
updates best score by searching in the population for the individual that best fits the given data
Definition at line 288 of file engine.cpp.
Archive<T> Brush::Engine< T >::archive |
int Brush::Engine< T >::best_complexity |
Individual<T> Brush::Engine< T >::best_ind |
float Brush::Engine< T >::best_score |
|
private |
|
private |
Parameters Brush::Engine< T >::params |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |