Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
Brush::Fitness Struct Reference

Represents the fitness of an individual in the Brush namespace. More...

#include <fitness.h>

Collaboration diagram for Brush::Fitness:

Public Member Functions

void set_dominated (vector< unsigned int > &dom)
 
vector< unsigned intget_dominated () const
 
void set_loss (float f)
 
float get_loss () const
 
void set_loss_v (float f_v)
 
float get_loss_v () const
 
void set_size (unsigned int new_s)
 
unsigned int get_size () const
 
void set_complexity (unsigned int new_c)
 
unsigned int get_complexity () const
 
void set_depth (unsigned int new_d)
 
unsigned int get_depth () const
 
void set_dcounter (unsigned int d)
 
unsigned int get_dcounter () const
 
void set_rank (unsigned r)
 
size_t get_rank () const
 
void set_crowding_dist (float cd)
 
float get_crowding_dist () const
 
 Fitness (const vector< float > &w={})
 
size_t hash () const
 
void set_weights (vector< float > &w)
 
vector< floatget_weights () const
 
vector< floatget_values () const
 
vector< floatget_wvalues () const
 
void set_values (vector< float > &v)
 
void clearValues ()
 
bool valid () const
 
bool operator== (const Fitness &other) const
 
bool operator!= (const Fitness &other) const
 
bool operator< (const Fitness &other) const
 
bool operator> (const Fitness &other) const
 
bool operator<= (const Fitness &other) const
 
bool operator>= (const Fitness &other) const
 
std::string toString () const
 
std::string repr () const
 
int dominates (const Fitness &b) const
 set obj vector given a string of objective names
 

Public Attributes

float loss
 aggregate loss score
 
float loss_v
 aggregate validation loss score
 
unsigned int complexity
 
unsigned int size
 
unsigned int depth
 
unsigned int dcounter
 number of individuals this dominates
 
vector< unsigned intdominated
 individual indices this dominates
 
unsigned int rank
 pareto front rank
 
float crowding_dist
 crowding distance on the Pareto front
 
vector< floatvalues
 
vector< floatweights
 
vector< floatwvalues
 

Detailed Description

Represents the fitness of an individual in the Brush namespace.

The Fitness struct stores various attributes related to the fitness of an individual in the Brush namespace. It includes the aggregate loss score, aggregate validation loss score, complexity, size, depth, dominance counter, dominated individuals, Pareto front rank, crowding distance on the Pareto front, weighted values, and weights.

The struct provides getter and setter methods for accessing and modifying these attributes. It also includes methods for calculating the hash value, setting values, clearing values, checking validity, and performing comparison operations.

Additionally, there are methods for converting the Fitness object to JSON format and vice versa.

Definition at line 25 of file fitness.h.

Constructor & Destructor Documentation

◆ Fitness()

Brush::Fitness::Fitness ( const vector< float > & w = {})
inline

Definition at line 75 of file fitness.h.

Member Function Documentation

◆ clearValues()

void Brush::Fitness::clearValues ( )
inline

Definition at line 125 of file fitness.h.

◆ dominates()

int Brush::Fitness::dominates ( const Fitness & b) const

set obj vector given a string of objective names

Definition at line 41 of file fitness.cpp.

Here is the call graph for this function:

◆ get_complexity()

unsigned int Brush::Fitness::get_complexity ( ) const
inline

Definition at line 60 of file fitness.h.

◆ get_crowding_dist()

float Brush::Fitness::get_crowding_dist ( ) const
inline

Definition at line 72 of file fitness.h.

◆ get_dcounter()

unsigned int Brush::Fitness::get_dcounter ( ) const
inline

Definition at line 66 of file fitness.h.

◆ get_depth()

unsigned int Brush::Fitness::get_depth ( ) const
inline

Definition at line 63 of file fitness.h.

◆ get_dominated()

vector< unsigned int > Brush::Fitness::get_dominated ( ) const
inline

Definition at line 48 of file fitness.h.

◆ get_loss()

float Brush::Fitness::get_loss ( ) const
inline

Definition at line 51 of file fitness.h.

Here is the caller graph for this function:

◆ get_loss_v()

float Brush::Fitness::get_loss_v ( ) const
inline

Definition at line 54 of file fitness.h.

◆ get_rank()

size_t Brush::Fitness::get_rank ( ) const
inline

Definition at line 69 of file fitness.h.

◆ get_size()

unsigned int Brush::Fitness::get_size ( ) const
inline

Definition at line 57 of file fitness.h.

◆ get_values()

vector< float > Brush::Fitness::get_values ( ) const
inline

Definition at line 95 of file fitness.h.

◆ get_weights()

vector< float > Brush::Fitness::get_weights ( ) const
inline

Definition at line 92 of file fitness.h.

◆ get_wvalues()

vector< float > Brush::Fitness::get_wvalues ( ) const
inline

Definition at line 98 of file fitness.h.

Here is the caller graph for this function:

◆ hash()

size_t Brush::Fitness::hash ( ) const
inline

Definition at line 84 of file fitness.h.

Here is the call graph for this function:

◆ operator!=()

bool Brush::Fitness::operator!= ( const Fitness & other) const
inline

Definition at line 139 of file fitness.h.

Here is the call graph for this function:

◆ operator<()

bool Brush::Fitness::operator< ( const Fitness & other) const
inline

Definition at line 144 of file fitness.h.

Here is the call graph for this function:

◆ operator<=()

bool Brush::Fitness::operator<= ( const Fitness & other) const
inline

Definition at line 156 of file fitness.h.

Here is the call graph for this function:

◆ operator==()

bool Brush::Fitness::operator== ( const Fitness & other) const
inline

Definition at line 134 of file fitness.h.

Here is the call graph for this function:

◆ operator>()

bool Brush::Fitness::operator> ( const Fitness & other) const
inline

Definition at line 151 of file fitness.h.

Here is the call graph for this function:

◆ operator>=()

bool Brush::Fitness::operator>= ( const Fitness & other) const
inline

Definition at line 161 of file fitness.h.

Here is the call graph for this function:

◆ repr()

std::string Brush::Fitness::repr ( ) const
inline

Definition at line 178 of file fitness.h.

Here is the call graph for this function:

◆ set_complexity()

void Brush::Fitness::set_complexity ( unsigned int new_c)
inline

Definition at line 59 of file fitness.h.

Here is the call graph for this function:

◆ set_crowding_dist()

void Brush::Fitness::set_crowding_dist ( float cd)
inline

Definition at line 71 of file fitness.h.

Here is the call graph for this function:

◆ set_dcounter()

void Brush::Fitness::set_dcounter ( unsigned int d)
inline

Definition at line 65 of file fitness.h.

Here is the call graph for this function:

◆ set_depth()

void Brush::Fitness::set_depth ( unsigned int new_d)
inline

Definition at line 62 of file fitness.h.

Here is the call graph for this function:

◆ set_dominated()

void Brush::Fitness::set_dominated ( vector< unsigned int > & dom)
inline

Definition at line 47 of file fitness.h.

Here is the call graph for this function:

◆ set_loss()

void Brush::Fitness::set_loss ( float f)
inline

Definition at line 50 of file fitness.h.

Here is the call graph for this function:

◆ set_loss_v()

void Brush::Fitness::set_loss_v ( float f_v)
inline

Definition at line 53 of file fitness.h.

Here is the call graph for this function:

◆ set_rank()

void Brush::Fitness::set_rank ( unsigned r)
inline

Definition at line 68 of file fitness.h.

◆ set_size()

void Brush::Fitness::set_size ( unsigned int new_s)
inline

Definition at line 56 of file fitness.h.

Here is the call graph for this function:

◆ set_values()

void Brush::Fitness::set_values ( vector< float > & v)
inline

Definition at line 103 of file fitness.h.

Here is the call graph for this function:

◆ set_weights()

void Brush::Fitness::set_weights ( vector< float > & w)
inline

Definition at line 89 of file fitness.h.

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

◆ toString()

std::string Brush::Fitness::toString ( ) const
inline

Definition at line 166 of file fitness.h.

Here is the call graph for this function:

◆ valid()

bool Brush::Fitness::valid ( ) const
inline

Definition at line 129 of file fitness.h.

Here is the caller graph for this function:

Member Data Documentation

◆ complexity

unsigned int Brush::Fitness::complexity

Definition at line 31 of file fitness.h.

◆ crowding_dist

float Brush::Fitness::crowding_dist

crowding distance on the Pareto front

Definition at line 39 of file fitness.h.

◆ dcounter

unsigned int Brush::Fitness::dcounter

number of individuals this dominates

Definition at line 36 of file fitness.h.

◆ depth

unsigned int Brush::Fitness::depth

Definition at line 33 of file fitness.h.

◆ dominated

vector<unsigned int> Brush::Fitness::dominated

individual indices this dominates

Definition at line 37 of file fitness.h.

◆ loss

float Brush::Fitness::loss

aggregate loss score

Definition at line 28 of file fitness.h.

◆ loss_v

float Brush::Fitness::loss_v

aggregate validation loss score

Definition at line 29 of file fitness.h.

◆ rank

unsigned int Brush::Fitness::rank

pareto front rank

Definition at line 38 of file fitness.h.

◆ size

unsigned int Brush::Fitness::size

Definition at line 32 of file fitness.h.

◆ values

vector<float> Brush::Fitness::values

Definition at line 41 of file fitness.h.

◆ weights

vector<float> Brush::Fitness::weights

Definition at line 42 of file fitness.h.

◆ wvalues

vector<float> Brush::Fitness::wvalues

Definition at line 45 of file fitness.h.


The documentation for this struct was generated from the following files: