Score

group Score

Score

  • Score types (BDeu, K2, BIC, AIC)

  • Its helper (is_type, get_type), and

  • Score computation (citecalculate_local_score)

Typedefs

typedef std::variant<BDeu, K2, BIC, AIC> ScoreType

Type representing all possible score types.

Functions

double calculate_local_score(size_t child_var, const std::vector<size_t>&, const ContingencyTable &ct, const ScoreType &score_type = BDeu{1.0})

Calculate the local score for a given child variable.

Parameters:
  • child_var – The child variable for which to calculate the score.

  • parent_set – The set of parent variables.

  • ct – The contingency table.

  • score_type – The type of score to calculate.

Returns:

The calculated local score.

template<typename T>
bool is_type(const ScoreType &score)

Check if the score type is of a specific type.

Template Parameters:

T – A score type

Parameters:

score – A score type

Returns:

True if the score type is of the specific type; otherwise, false

template<typename T>
const T &get_type(const ScoreType &score)

Get the score type of a specific type.

Template Parameters:

T – A score type

Parameters:

score – A score type

Returns:

The score type of the specific type

struct BDeu
#include <score_type.h>

Structure representing the BDeu score type.

struct K2
#include <score_type.h>

Structure representing the K2 score type.

struct BIC
#include <score_type.h>

Structure representing the BIC score type.

struct AIC
#include <score_type.h>

Structure representing the AIC score type.