Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
dummy.cpp
Go to the documentation of this file.
1#include "dummy.h"
2
3namespace Brush {
4namespace MAB {
5
6template <typename T>
7std::map<T, float> DummyBandit<T>::sample_probs(bool update) {
8 return this->probabilities;
9}
10
11template <typename T>
12T DummyBandit<T>::choose(const VectorXf& context) {
13 // std::map<T, float> probs = this->sample_probs(false);
14
15 return r.random_choice(this->probabilities);
16}
17
18template <typename T>
19void DummyBandit<T>::update(T arm, float reward, VectorXf& context) {
20 // Do nothing
21}
22
23} // MAB
24} // Brush
std::map< T, float > probabilities
void update(T arm, float reward, VectorXf &context)
Updates the reward for a specific arm.
Definition dummy.cpp:19
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
static Rnd & r
Definition rnd.h:174
< nsga2 selection operator for getting the front
Definition bandit.cpp:4