6 : max_bins_per_var_(max_bins_per_var) {}
14 std::size_t state_idx) {
19 std::string old_name = metadata.
states[state_idx];
20 graph.
split_state(var, state_idx, old_name +
"_low", old_name +
"_high");
DiscretizationManager(std::size_t max_bins_per_var=50)
bool should_split(const Graph &graph, NodeId var) const
Tests whether a variable still has fewer states than the limit.
void split_bin(Graph &graph, NodeId var, std::size_t state_idx)
Splits one state of a variable into two.
std::size_t max_bins_per_var_
split_bin() is a no-op at or above this state count
Directed graphical model over discrete variables.
const VariableMetadata & get_variable(NodeId id) const
Metadata of a variable.
void split_state(NodeId id, std::size_t state_idx, const std::string &new_state1, const std::string &new_state2)
Replaces one state of a variable by two states.
bncore::DiscretizationManager, a helper that refines the state list of a Graph variable by splitting ...
std::uint32_t NodeId
Handle of a variable within one Graph.