35 using Iter = tree<Node>::pre_order_iterator;
41 std::shared_ptr<BanditOperator<T>>
pbandit;
100 void set_probs(map<T, float> arms_probs);
117 T
choose(
const VectorXf& context);
124 void update(T arm,
float reward, VectorXf& context);
126 template <ProgramType PT>
holds variable type data.
< nsga2 selection operator for getting the front
tree< Node >::pre_order_iterator Iter
tree< Node >::pre_order_iterator Iter
VectorXf get_context(const Program< PT > &program, Iter spot, const SearchSpace &ss, const Dataset &d)
T choose(const VectorXf &context)
Selects an arm using the tree and fitness as context.
std::shared_ptr< BanditOperator< T > > pbandit
A shared pointer to the bandit operator (policy).
void set_arms(vector< T > arms)
Sets the arms of the bandit.
string get_type()
Gets the type of the bandit.
void set_type(string type)
Sets the type of the bandit.
vector< T > get_arms()
Gets the arms of the bandit.
map< T, float > get_probs()
Gets the probabilities associated with each arm.
void update(T arm, float reward, VectorXf &context)
Updates the bandit's state based on the chosen arm and the received reward.
std::map< T, float > probabilities
void set_probs(map< T, float > arms_probs)
Sets the probabilities associated with each arm.
void set_bandit()
Sets the bandit operator (policy).
map< T, float > sample_probs(bool update=false)
Samples the probabilities associated with each arm using the policy.
An individual program, a.k.a. model.
Holds a search space, consisting of operations and terminals and functions, and methods to sample tha...