Brush C++ API
A flexible interpretable machine learning framework
Toggle main menu visibility
Loading...
Searching...
No Matches
selection.h
Go to the documentation of this file.
1
/* Brush
2
copyright 2020 William La Cava
3
license: GNU/GPL v3
4
*/
5
6
#ifndef SELECTION_H
7
#define SELECTION_H
8
9
#include "
selection_operator.h
"
10
#include "
nsga2.h
"
11
#include "
lexicase.h
"
12
13
namespace
Brush
{
14
namespace
Sel
{
15
16
using namespace
Brush;
17
using namespace
Pop
;
18
23
template
<ProgramType T>
24
struct
Selection
25
{
26
public
:
27
std::shared_ptr<SelectionOperator<T>>
pselector
;
28
string
type
;
29
bool
survival
;
30
31
Selection
();
32
~Selection
(){};
33
Selection
(
string
type
,
bool
survival
);
34
35
void
set_operator
();
36
38
string
get_type
();
39
void
set_type
(
string
);
40
42
vector<size_t>
select
(
Population<T>
& pop,
int
island,
43
const
Parameters
& params);
44
46
vector<size_t>
survive
(
Population<T>
& pop,
int
island,
47
const
Parameters
& params);
48
};
49
50
extern
template
struct
Selection<PT::Regressor>
;
51
extern
template
struct
Selection<PT::BinaryClassifier>
;
52
extern
template
struct
Selection<PT::MulticlassClassifier>
;
53
extern
template
struct
Selection<PT::Representer>
;
54
55
}
// Sel
56
}
// Brush
57
#endif
Brush::Pop::Population
Definition
population.h:12
lexicase.h
Brush::Pop
Definition
individual.cpp:4
Brush::Sel
Definition
lexicase.cpp:4
Brush
< nsga2 selection operator for getting the front
Definition
bandit.cpp:3
nsga2.h
selection_operator.h
Brush::Parameters
Definition
params.h:20
Brush::Sel::Selection
interfaces with selection operators.
Definition
selection.h:25
Brush::Sel::Selection::select
vector< size_t > select(Population< T > &pop, int island, const Parameters ¶ms)
perform selection. selection uses a pop that has no offspring space
Definition
selection.cpp:51
Brush::Sel::Selection::survival
bool survival
Definition
selection.h:29
Brush::Sel::Selection::get_type
string get_type()
return type of selectionoperator
Definition
selection.cpp:43
Brush::Sel::Selection::~Selection
~Selection()
Definition
selection.h:32
Brush::Sel::Selection::set_type
void set_type(string)
set type of selectionoperator
Definition
selection.cpp:47
Brush::Sel::Selection::type
string type
Definition
selection.h:28
Brush::Sel::Selection::survive
vector< size_t > survive(Population< T > &pop, int island, const Parameters ¶ms)
perform survival. uses a pop with offspring space
Definition
selection.cpp:59
Brush::Sel::Selection::set_operator
void set_operator()
Definition
selection.cpp:30
Brush::Sel::Selection::Selection
Selection()
Definition
selection.cpp:10
Brush::Sel::Selection::pselector
std::shared_ptr< SelectionOperator< T > > pselector
Definition
selection.h:27
src
selection
selection.h
Generated by
1.17.0