Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
dummy.h
Go to the documentation of this file.
1#include "bandit_operator.h"
2
3#ifndef DUMMY_H
4#define DUMMY_H
5
6#include "bandit_operator.h"
7
8namespace Brush {
9namespace MAB {
10
11// TODO: rename dummy to static or fixed
12
13template <typename T>
14class DummyBandit : public BanditOperator<T>
15{
16public:
17 DummyBandit(vector<T> arms) : BanditOperator<T>(arms) {};
18 DummyBandit(map<T, float> arms_probs) : BanditOperator<T>(arms_probs) {};
20
21 std::map<T, float> sample_probs(bool update);
22 T choose(const VectorXf& context);
23 void update(T arm, float reward, VectorXf& context);
24
25private:
26 // additional stuff should come here
27};
28
29} // MAB
30} // Brush
31
32#endif // DUMMY_H
BanditOperator(vector< T > arms)
Constructs a BanditOperator object with a vector of arms.
void update(T arm, float reward, VectorXf &context)
Updates the reward for a specific arm.
Definition dummy.cpp:19
DummyBandit(vector< T > arms)
Definition dummy.h:17
DummyBandit(map< T, float > arms_probs)
Definition dummy.h:18
T choose(const VectorXf &context)
Chooses an arm based on the given tree and fitness. Should call sample_probs internally.
Definition dummy.cpp:12
std::map< T, float > sample_probs(bool update)
Samples the probabilities of the arms.
Definition dummy.cpp:7
< nsga2 selection operator for getting the front
Definition bandit.cpp:4