Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
evaluation.h
Go to the documentation of this file.
1
2#ifndef EVALUATION_H
3#define EVALUATION_H
4
5#include <string>
6
8#include "../ind/individual.h"
9#include "../data/data.h"
10#include "scorer.h"
11#include "../pop/population.h"
12
13using std::string;
14
15namespace Brush {
16
17using namespace Pop;
18
19namespace Eval {
20
21template<ProgramType T>
27public:
34 // TODO: make eval update loss_v accordingly, and set to th same as train loss if there is no batch or no validation
35
36 string scorer;
39 scorer = "multi_log";
41 scorer = "log";
42 else
43 scorer = "mse";
44
45 this->S.set_scorer(scorer);
46 };
48
53 void set_scorer(string scorer){this->S.set_scorer(scorer);};
54
59 string get_scorer(){return this->S.get_scorer();};
60
71 int island,
72 const Dataset& data,
73 const Parameters& params,
74 bool fit=true,
75 bool validation=false
76 );
77
85 void assign_fit(Individual<T>& ind, const Dataset& data,
86 const Parameters& params, bool val=false);
87
88 // representation program (TODO: implement)
89};
90
91} //selection
92} //brush
93#endif
void bind_engine(py::module &m, string name)
holds variable type data.
Definition data.h:51
Class for evaluating the fitness of individuals in a population.
Definition evaluation.h:26
void update_fitness(Population< T > &pop, int island, const Dataset &data, const Parameters &params, bool fit=true, bool validation=false)
Update the fitness of individuals in a population.
Definition evaluation.cpp:9
void set_scorer(string scorer)
Set the scorer for evaluation.
Definition evaluation.h:53
Evaluation()
Constructor for Evaluation class.
Definition evaluation.h:33
string get_scorer()
Get the current scorer.
Definition evaluation.h:59
void assign_fit(Individual< T > &ind, const Dataset &data, const Parameters &params, bool val=false)
Assign fitness to an individual.
string get_scorer()
Definition scorer.h:42
void set_scorer(string scorer)
Definition scorer.h:41
< nsga2 selection operator for getting the front
Definition data.cpp:12
Namespace containing scoring functions for evaluation metrics.