Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
Brush::MAB::DummyBandit Class Reference

#include <dummy.h>

Inheritance diagram for Brush::MAB::DummyBandit:
Collaboration diagram for Brush::MAB::DummyBandit:

Public Member Functions

 DummyBandit (vector< string > arms)
 
 DummyBandit (map< string, float > arms_probs)
 
 ~DummyBandit ()
 
std::map< string, float > sample_probs (bool update)
 Samples the probabilities of the arms.
 
string choose ()
 Chooses an arm based on the given tree and fitness. Should call sample_probs internally.
 
void update (string arm, float reward)
 Updates the reward for a specific arm.
 
- Public Member Functions inherited from Brush::MAB::BanditOperator
 BanditOperator (vector< string > arms)
 Constructs a BanditOperator object with a vector of arms.
 
 BanditOperator (map< string, float > arms_probs)
 Constructs a BanditOperator object with a map of arms and their probabilities.
 
 ~BanditOperator ()
 

Additional Inherited Members

- Protected Attributes inherited from Brush::MAB::BanditOperator
std::map< string, float > probabilities
 

Detailed Description

Definition at line 13 of file dummy.h.

Constructor & Destructor Documentation

◆ DummyBandit() [1/2]

Brush::MAB::DummyBandit::DummyBandit ( vector< string > arms)
inline

Definition at line 16 of file dummy.h.

Here is the call graph for this function:

◆ DummyBandit() [2/2]

Brush::MAB::DummyBandit::DummyBandit ( map< string, float > arms_probs)
inline

Definition at line 17 of file dummy.h.

Here is the call graph for this function:

◆ ~DummyBandit()

Brush::MAB::DummyBandit::~DummyBandit ( )
inline

Definition at line 18 of file dummy.h.

Member Function Documentation

◆ choose()

string Brush::MAB::DummyBandit::choose ( )
virtual

Chooses an arm based on the given tree and fitness. Should call sample_probs internally.

Parameters
treeThe tree structure used to choose the arm.
fThe fitness value used to influence the choice.
Returns
The arm with highest probability.

Reimplemented from Brush::MAB::BanditOperator.

Definition at line 10 of file dummy.cpp.

◆ sample_probs()

std::map< string, float > Brush::MAB::DummyBandit::sample_probs ( bool update)
virtual

Samples the probabilities of the arms.

Parameters
updateA boolean indicating whether to update the probabilities.
Returns
A map of arms and their probabilities.

Reimplemented from Brush::MAB::BanditOperator.

Definition at line 6 of file dummy.cpp.

Here is the call graph for this function:

◆ update()

void Brush::MAB::DummyBandit::update ( string arm,
float reward )
virtual

Updates the reward for a specific arm.

Parameters
armThe arm for which to update the reward.
rewardThe reward value.

Reimplemented from Brush::MAB::BanditOperator.

Definition at line 16 of file dummy.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: