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
19// TODO: rename this file and class to evaluator?
20namespace Eval {
21
22template<ProgramType T>
28public:
35 // TODO: make eval update loss_v accordingly, and set to th same as train loss if there is no batch or no validation
36
37 // TODO: make accuracy the main classification metric?
38 string scorer;
41 scorer = "multi_log";
43 scorer = "log";
44 else
45 scorer = "mse";
46
47 this->S.set_scorer(scorer);
48 };
50
55 void set_scorer(string scorer){this->S.set_scorer(scorer);};
56
61 string get_scorer(){return this->S.get_scorer();};
62
73 int island,
74 const Dataset& data,
75 const Parameters& params,
76 bool fit=true,
77 bool validation=true // if there is no validation, then loss_v==loss
78 );
79
87 void assign_fit(Individual<T>& ind, const Dataset& data,
88 const Parameters& params, bool val=false);
89
90 // representation program (TODO: implement)
91};
92
93} //selection
94} //brush
95#endif
holds variable type data.
Definition data.h:51
void update_fitness(Population< T > &pop, int island, const Dataset &data, const Parameters &params, bool fit=true, bool validation=true)
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:55
Evaluation()
Constructor for Evaluation class.
Definition evaluation.h:34
string get_scorer()
Get the current scorer.
Definition evaluation.h:61
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 bandit.cpp:4