Brush C++ API
A flexible interpretable machine learning framework
Toggle main menu visibility
Loading...
Searching...
No Matches
bandit_operator.h
Go to the documentation of this file.
1
#ifndef BANDIT_OPERATOR_H
2
#define BANDIT_OPERATOR_H
3
4
#include "
../init.h
"
5
// #include "../data/data.h"
6
#include "
../types.h
"
7
#include "
../params.h
"
8
#include "
../program/tree_node.h
"
9
#include "
../ind/fitness.h
"
10
11
namespace
Brush
{
12
namespace
MAB
{
13
21
class
BanditOperator
22
{
23
using
Iter
= tree<Node>::pre_order_iterator;
24
public
:
30
BanditOperator
(vector<string> arms);
31
37
BanditOperator
(map<string, float> arms_probs);
38
39
~BanditOperator
() {};
40
47
virtual
std::map<string, float>
sample_probs
(
bool
update
);
48
56
virtual
string
choose
();
57
64
virtual
void
update
(
string
arm,
float
reward);
65
protected
:
66
std::map<string, float>
probabilities
;
67
};
68
69
}
// MAB
70
}
// Brush
71
72
#endif
// BANDIT_OPERATOR_H
Brush::MAB::BanditOperator::~BanditOperator
~BanditOperator()
Definition
bandit_operator.h:39
Brush::MAB::BanditOperator::probabilities
std::map< string, float > probabilities
Definition
bandit_operator.h:66
Brush::MAB::BanditOperator::update
virtual void update(string arm, float reward)
Updates the reward for a specific arm.
Definition
bandit_operator.cpp:49
Brush::MAB::BanditOperator::choose
virtual string choose()
Chooses an arm based on the given tree and fitness. Should call sample_probs internally.
Definition
bandit_operator.cpp:37
Brush::MAB::BanditOperator::BanditOperator
BanditOperator(vector< string > arms)
Constructs a BanditOperator object with a vector of arms.
Definition
bandit_operator.cpp:6
Brush::MAB::BanditOperator::Iter
tree< Node >::pre_order_iterator Iter
Definition
bandit_operator.h:23
Brush::MAB::BanditOperator::sample_probs
virtual std::map< string, float > sample_probs(bool update)
Samples the probabilities of the arms.
Definition
bandit_operator.cpp:25
fitness.h
init.h
Brush::MAB
Definition
bandit.cpp:4
Brush
< nsga2 selection operator for getting the front
Definition
bandit.cpp:3
params.h
tree_node.h
types.h
src
bandit
bandit_operator.h
Generated by
1.17.0