Brush C++ API
A flexible interpretable machine learning framework
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"
9#include "../ind/fitness.h"
10
11namespace Brush {
12namespace MAB {
13
22{
23 using Iter = tree<Node>::pre_order_iterator;
24public:
30 BanditOperator(vector<string> arms);
31
37 BanditOperator(map<string, float> arms_probs);
38
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);
65protected:
66 std::map<string, float> probabilities;
67};
68
69} // MAB
70} // Brush
71
72#endif // BANDIT_OPERATOR_H
std::map< string, float > probabilities
virtual void update(string arm, float reward)
Updates the reward for a specific arm.
virtual string choose()
Chooses an arm based on the given tree and fitness. Should call sample_probs internally.
BanditOperator(vector< string > arms)
Constructs a BanditOperator object with a vector of arms.
tree< Node >::pre_order_iterator Iter
virtual std::map< string, float > sample_probs(bool update)
Samples the probabilities of the arms.
< nsga2 selection operator for getting the front
Definition bandit.cpp:4