Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
Brush::Pop::Individual< T > Class Template Reference

#include <individual.h>

Collaboration diagram for Brush::Pop::Individual< T >:

Public Member Functions

 Individual ()
 
 Individual (Program< T > &prg)
 
void init (SearchSpace &ss, const Parameters &params)
 
Individual< T > & fit (const Dataset &data)
 
Individual< T > & fit (const Ref< const ArrayXXf > &X, const Ref< const ArrayXf > &y)
 
auto predict (const Dataset &data)
 
auto predict (const Ref< const ArrayXXf > &X)
 
template<ProgramType P = T>
requires ((P == PT::BinaryClassifier) || (P == PT::MulticlassClassifier))
auto predict_proba (const Dataset &d)
 
template<ProgramType P = T>
requires ((P == PT::BinaryClassifier) || (P == PT::MulticlassClassifier))
auto predict_proba (const Ref< const ArrayXXf > &X)
 
bool get_is_fitted () const
 
unsigned int get_size () const
 
unsigned int get_depth () const
 
unsigned int get_complexity () const
 
Program< T > & get_program ()
 
string get_model (string fmt="compact", bool pretty=false)
 
string get_dot_model (string extras="")
 
void set_fitness (Fitness &f)
 
Fitnessget_fitness ()
 
void set_id (unsigned i)
 
void set_parents (const vector< Individual< T > > &parents)
 
void set_parents (const vector< unsigned > &parents)
 set parent ids using parents

 
vector< string > get_objectives () const
 
void set_objectives (vector< string > objs)
 

Public Attributes

Program< T > program
 executable data structure
 
bool is_fitted_ = false
 
unsigned id
 tracking id
 
vector< unsignedparent_id
 ids of parents
 
VectorXf error
 training error (used in lexicase selectors)
 
Fitness fitness
 aggregate fitness score
 
vector< string > objectives
 objectives for use with Pareto selection
 

Static Public Attributes

static std::map< std::string, floatweightsMap
 set parent ids using id values
 

Detailed Description

template<ProgramType T>
class Brush::Pop::Individual< T >

Definition at line 15 of file individual.h.

Constructor & Destructor Documentation

◆ Individual() [1/2]

template<ProgramType T>
Brush::Pop::Individual< T >::Individual ( )
inline

Definition at line 37 of file individual.h.

◆ Individual() [2/2]

template<ProgramType T>
Brush::Pop::Individual< T >::Individual ( Program< T > & prg)
inline

Definition at line 43 of file individual.h.

Here is the call graph for this function:

Member Function Documentation

◆ fit() [1/2]

template<ProgramType T>
Individual< T > & Brush::Pop::Individual< T >::fit ( const Dataset & data)
inline

Definition at line 55 of file individual.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fit() [2/2]

template<ProgramType T>
Individual< T > & Brush::Pop::Individual< T >::fit ( const Ref< const ArrayXXf > & X,
const Ref< const ArrayXf > & y )
inline

Definition at line 60 of file individual.h.

Here is the call graph for this function:

◆ get_complexity()

template<ProgramType T>
unsigned int Brush::Pop::Individual< T >::get_complexity ( ) const
inline

Definition at line 88 of file individual.h.

Here is the call graph for this function:

◆ get_depth()

template<ProgramType T>
unsigned int Brush::Pop::Individual< T >::get_depth ( ) const
inline

Definition at line 87 of file individual.h.

Here is the call graph for this function:

◆ get_dot_model()

template<ProgramType T>
string Brush::Pop::Individual< T >::get_dot_model ( string extras = "")
inline

Definition at line 93 of file individual.h.

Here is the call graph for this function:

◆ get_fitness()

template<ProgramType T>
Fitness & Brush::Pop::Individual< T >::get_fitness ( )
inline

Definition at line 97 of file individual.h.

◆ get_is_fitted()

template<ProgramType T>
bool Brush::Pop::Individual< T >::get_is_fitted ( ) const
inline

Definition at line 85 of file individual.h.

◆ get_model()

template<ProgramType T>
string Brush::Pop::Individual< T >::get_model ( string fmt = "compact",
bool pretty = false )
inline

Definition at line 91 of file individual.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_objectives()

template<ProgramType T>
vector< string > Brush::Pop::Individual< T >::get_objectives ( ) const
inline

Definition at line 127 of file individual.h.

Here is the caller graph for this function:

◆ get_program()

template<ProgramType T>
Program< T > & Brush::Pop::Individual< T >::get_program ( )
inline

Definition at line 89 of file individual.h.

◆ get_size()

template<ProgramType T>
unsigned int Brush::Pop::Individual< T >::get_size ( ) const
inline

Definition at line 86 of file individual.h.

Here is the call graph for this function:

◆ init()

template<ProgramType T>
void Brush::Pop::Individual< T >::init ( SearchSpace & ss,
const Parameters & params )
inline

Definition at line 45 of file individual.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ predict() [1/2]

template<ProgramType T>
auto Brush::Pop::Individual< T >::predict ( const Dataset & data)
inline

Definition at line 66 of file individual.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ predict() [2/2]

template<ProgramType T>
auto Brush::Pop::Individual< T >::predict ( const Ref< const ArrayXXf > & X)
inline

Definition at line 67 of file individual.h.

Here is the call graph for this function:

◆ predict_proba() [1/2]

template<ProgramType T>
template<ProgramType P = T>
requires ((P == PT::BinaryClassifier) || (P == PT::MulticlassClassifier))
auto Brush::Pop::Individual< T >::predict_proba ( const Dataset & d)
inline

Definition at line 75 of file individual.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ predict_proba() [2/2]

template<ProgramType T>
template<ProgramType P = T>
requires ((P == PT::BinaryClassifier) || (P == PT::MulticlassClassifier))
auto Brush::Pop::Individual< T >::predict_proba ( const Ref< const ArrayXXf > & X)
inline

Definition at line 78 of file individual.h.

Here is the call graph for this function:

◆ set_fitness()

template<ProgramType T>
void Brush::Pop::Individual< T >::set_fitness ( Fitness & f)
inline

Definition at line 96 of file individual.h.

Here is the call graph for this function:

◆ set_id()

template<ProgramType T>
void Brush::Pop::Individual< T >::set_id ( unsigned i)
inline

Definition at line 99 of file individual.h.

Here is the call graph for this function:

◆ set_objectives()

template<ProgramType T>
void Brush::Pop::Individual< T >::set_objectives ( vector< string > objs)
inline

Definition at line 128 of file individual.h.

Here is the call graph for this function:

◆ set_parents() [1/2]

template<ProgramType T>
void Brush::Pop::Individual< T >::set_parents ( const vector< Individual< T > > & parents)
inline

Definition at line 100 of file individual.h.

Here is the call graph for this function:

◆ set_parents() [2/2]

template<ProgramType T>
void Brush::Pop::Individual< T >::set_parents ( const vector< unsigned > & parents)
inline

set parent ids using parents

Definition at line 105 of file individual.h.

Here is the call graph for this function:

Member Data Documentation

◆ error

template<ProgramType T>
VectorXf Brush::Pop::Individual< T >::error

training error (used in lexicase selectors)

Definition at line 31 of file individual.h.

◆ fitness

template<ProgramType T>
Fitness Brush::Pop::Individual< T >::fitness

aggregate fitness score

Definition at line 33 of file individual.h.

◆ id

tracking id

Definition at line 28 of file individual.h.

◆ is_fitted_

template<ProgramType T>
bool Brush::Pop::Individual< T >::is_fitted_ = false

Definition at line 24 of file individual.h.

◆ objectives

template<ProgramType T>
vector<string> Brush::Pop::Individual< T >::objectives

objectives for use with Pareto selection

Definition at line 35 of file individual.h.

◆ parent_id

template<ProgramType T>
vector<unsigned> Brush::Pop::Individual< T >::parent_id

ids of parents

Definition at line 29 of file individual.h.

◆ program

template<ProgramType T>
Program<T> Brush::Pop::Individual< T >::program

executable data structure

Definition at line 17 of file individual.h.

◆ weightsMap

template<ProgramType T>
std::map<std::string, float> Brush::Pop::Individual< T >::weightsMap
inlinestatic
Initial value:
= {
{"complexity", -1.0},
{"size", -1.0},
{"mse", -1.0},
{"log", -1.0},
{"multi_log", -1.0},
{"average_precision_score", +1.0},
{"accuracy", +1.0},
{"error", -1.0}
}

set parent ids using id values

Definition at line 116 of file individual.h.


The documentation for this class was generated from the following file: