Interface IsScore
- All Known Implementing Classes:
IsBDeuScore,IsBicScore
This score adapts the standard Bayesian Information Criterion (BIC) to the instance-specific setting. As with the population version, the likelihood term is based on empirical counts, and the penalty term is proportional to the number of free parameters in the local conditional distribution:
BIC = log-likelihood – 0.5 * penaltyDiscount * (numParams) * log(N)
where numParams = r_p * (K – 1), with r_p equal to the product
of category counts of the parent set and K the number of categories of the child variable.
The instance-specific contribution does not alter the likelihood computation itself. Instead, it is incorporated through a structure prior that rewards or penalizes local modifications (addition, removal, or reversal of parents) relative to the baseline population model. In this way, IS-BIC balances population-wide fit with adjustments that highlight edges most relevant to the chosen test case.
This score is intended for use by search algorithms such as IS-FGES and IS-GFCI, providing a lightweight alternative to IS-BDeu when a BIC-style criterion is preferred.
Usage Notes
- Currently supports discrete variables only.
- Continuous data should be discretized before applying this score.
- Author:
- fattaneh
-
Method Summary
Modifier and TypeMethodDescriptionbooleandetermines(List<Node> z, Node y) Determines whether the given list of nodes has a specific relationship with the specified node.Retrieves the dataset used in the scoring calculations.intRetrieves the maximum allowable degree for nodes in the current scoring context.doubleRetrieves the prior probability assigned to the sample.intRetrieves the sample size used in the score computation.doubleRetrieves the prior value assigned to the structure.getVariable(String targetName) Retrieves a variable node by its target name.Retrieves a list of variables represented as nodes.booleanisEffectEdge(double bump) Determines whether the edge has a significant effect based on the given bump value.doublelocalScore(int node, int[] parents_is, int[] parents_pop, int[] children_population) Calculates the local score for a given node in the context of its parent nodes and children population.doublelocalScore1(int node, int[] parents_is, int[] parents_pop, int[] children_pop) Calculates the local score for a given node in the context of its parent nodes and children population, without using structure prior.doublelocalScoreDiff(int x, int y, int[] parentsY_is, int[] parentsY_pop, int[] childrenY_pop) Calculates the difference between local scores before and after introducing a change in the relationship between nodes x and y, considering their parent and children populations.voidsetSamplePrior(double samplePrior) Sets the prior probability value assigned to the sample.voidsetStructurePrior(double structurePrior) Sets the prior value assigned to the structure.
-
Method Details
-
localScore
double localScore(int node, int[] parents_is, int[] parents_pop, int[] children_population) Calculates the local score for a given node in the context of its parent nodes and children population.- Parameters:
node- The index of the node for which the score is being calculated.parents_is- An array representing the indices of the parent nodes.parents_pop- An array representing the population of the parent nodes.children_population- An array representing the population of the children nodes.- Returns:
- The local score for the specified node.
-
localScoreDiff
double localScoreDiff(int x, int y, int[] parentsY_is, int[] parentsY_pop, int[] childrenY_pop) Calculates the difference between local scores before and after introducing a change in the relationship between nodes x and y, considering their parent and children populations.- Parameters:
x- The index of the node x.y- The index of the node y.parentsY_is- An array of indices representing the parent nodes of y.parentsY_pop- An array of indices representing the population of parent nodes of y.childrenY_pop- An array of indices representing the population of children nodes of y.- Returns:
- The difference in local scores due to the relationship change between x and y.
-
getVariables
Retrieves a list of variables represented as nodes.- Returns:
- A list of nodes representing the variables.
-
isEffectEdge
boolean isEffectEdge(double bump) Determines whether the edge has a significant effect based on the given bump value.- Parameters:
bump- The threshold value to evaluate the significance of the effect on the edge.- Returns:
- true if the edge has a significant effect; false otherwise.
-
getSampleSize
int getSampleSize()Retrieves the sample size used in the score computation.- Returns:
- the sample size.
-
getVariable
Retrieves a variable node by its target name.- Parameters:
targetName- the name of the target variable to retrieve- Returns:
- the node representing the variable with the specified target name
-
getMaxDegree
int getMaxDegree()Retrieves the maximum allowable degree for nodes in the current scoring context.- Returns:
- The maximum degree a node can have.
-
determines
Determines whether the given list of nodes has a specific relationship with the specified node.- Parameters:
z- the list of nodes to be evaluated.y- the node to be checked against the list.- Returns:
- true if the list of nodes determines the specified node; false otherwise.
-
localScore1
double localScore1(int node, int[] parents_is, int[] parents_pop, int[] children_pop) Calculates the local score for a given node in the context of its parent nodes and children population, without using structure prior.same as localSCire but this one doesn't use structure prior
- Parameters:
node- The index of the node for which the score is being calculated.parents_is- An array representing the indices of the parent nodes.parents_pop- An array representing the population of the parent nodes.children_pop- An array representing the population of the children nodes.- Returns:
- The local score for the specified node.
-
getStructurePrior
double getStructurePrior()Retrieves the prior value assigned to the structure.- Returns:
- the structure prior value as a double.
-
setStructurePrior
void setStructurePrior(double structurePrior) Sets the prior value assigned to the structure.- Parameters:
structurePrior- the structure prior value to be set as a double.
-
getSamplePrior
double getSamplePrior()Retrieves the prior probability assigned to the sample.- Returns:
- the sample prior value as a double.
-
setSamplePrior
void setSamplePrior(double samplePrior) Sets the prior probability value assigned to the sample.- Parameters:
samplePrior- the sample prior value to be set as a double.
-
getDataSet
DataSet getDataSet()Retrieves the dataset used in the scoring calculations.- Returns:
- the dataset used in the scoring calculations.
-