Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
lexicase.h
Go to the documentation of this file.
1#ifndef LEXICASE_H
2#define LEXICASE_H
3
5#include "../util/utils.h"
6
7namespace Brush {
8namespace Sel {
9
10using namespace Brush;
11using namespace Pop;
12using namespace Sel;
13
14
19
20template<ProgramType T>
21class Lexicase : public SelectionOperator<T>
22{
23public:
24 Lexicase(bool surv=false);
26
28 vector<size_t> select(Population<T>& pop, int island,
29 const Parameters& p);
30
32 vector<size_t> survive(Population<T>& pop, int island,
33 const Parameters& p);
34
35 void set_lexicase_pool(vector<size_t> s) { this->lexicase_pool = s; }
36
37private:
38 vector<size_t> lexicase_pool;
39};
40
41extern template class Lexicase<PT::Regressor>;
42extern template class Lexicase<PT::BinaryClassifier>;
43extern template class Lexicase<PT::MulticlassClassifier>;
44extern template class Lexicase<PT::Representer>;
45
46} // Sel
47} // Brush
48#endif
Lexicase selection operator.
Definition lexicase.h:22
Lexicase(bool surv=false)
Definition lexicase.cpp:11
vector< size_t > survive(Population< T > &pop, int island, const Parameters &p)
lexicase survival
Definition lexicase.cpp:184
vector< size_t > select(Population< T > &pop, int island, const Parameters &p)
function returns a set of selected indices from pop
Definition lexicase.cpp:18
void set_lexicase_pool(vector< size_t > s)
Definition lexicase.h:35
vector< size_t > lexicase_pool
Definition lexicase.h:38
The SelectionOperator class represents a base class for selection operators in a genetic algorithm.
< nsga2 selection operator for getting the front
Definition bandit.cpp:3