Class IsBDeuScoreWrapper
java.lang.Object
edu.cmu.tetrad.algcomparison.score.IsBDeuScoreWrapper
- All Implemented Interfaces:
ScoreWrapper,HasKnowledge,HasParameters,TetradSerializable,Serializable
@Score(name="Instance-specific BDeu Score",
command="is-bdeu-score",
dataType=Discrete)
public final class IsBDeuScoreWrapper
extends Object
implements ScoreWrapper, HasKnowledge
Wrapper for ISBDeuScore (discrete). Pulls testing data from Params.TESTING_DATA and row from Params.INSTANCE_ROW.
Aligns by name and remaps category indices if the label orders differ.
- See Also:
-
Field Summary
Fields inherited from interface edu.cmu.tetrad.algcomparison.score.ScoreWrapper
serialVersionUID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the data type associated with this score wrapper.Provides a description of the Instance-Specific BDeu score, a discrete Dirichlet–multinomial posterior predictive score for the specific instance.Retrieves a copy of the current knowledge associated with this score wrapper.Retrieves a list of parameter names required by the Instance-Specific BDeu (ISBDeu) scoring algorithm.getScore(DataModel dataModel, Parameters parameters) Calculates and returns a score for the given data model and associated parameters.getVariable(String name) Retrieves a variable from the model by its name.voidsetKnowledge(Knowledge knowledge) Sets the knowledge used by this score wrapper.
-
Constructor Details
-
IsBDeuScoreWrapper
public IsBDeuScoreWrapper()Constructor for the `IsBDeuScoreWrapper` class. This class serves as a wrapper for the Instance-Specific BDeu (ISBDeu) scoring algorithm, which is designed for use with discrete data sets. The wrapper facilitates score calculations, description retrieval, and parameter management specific to ISBDeu scoring.
-
-
Method Details
-
getScore
Calculates and returns a score for the given data model and associated parameters.- Specified by:
getScorein interfaceScoreWrapper- Parameters:
dataModel- The data model to be scored. Must be an instance of a discreteDataSet.parameters- The parameters used for the score computation. Includes row index and optional hyperparameters.- Returns:
- The calculated score instance as an
IsBDeuScore. - Throws:
IllegalArgumentException- if the data model is not a discreteDataSet, if the testing data is not discrete, or if the row index is out of range.
-
getDescription
Provides a description of the Instance-Specific BDeu score, a discrete Dirichlet–multinomial posterior predictive score for the specific instance.- Specified by:
getDescriptionin interfaceScoreWrapper- Returns:
- A string describing the Instance-Specific BDeu score.
-
getDataType
Returns the data type associated with this score wrapper. The data type indicates that the score is intended for use with discrete data sets.- Specified by:
getDataTypein interfaceScoreWrapper- Returns:
- The data type
DataType.Discrete, representing compatibility with discrete data.
-
getParameters
Retrieves a list of parameter names required by the Instance-Specific BDeu (ISBDeu) scoring algorithm. These parameters are used in the computation of the ISBDeu score for a given data model.- Specified by:
getParametersin interfaceHasParameters- Specified by:
getParametersin interfaceScoreWrapper- Returns:
- A list of parameter names as strings, including alpha parameter, row index, and prior equivalent sample size. Additional parameters may be provided by algorithm wrappers.
-
getVariable
Retrieves a variable from the model by its name.- Specified by:
getVariablein interfaceScoreWrapper- Parameters:
name- The name of the variable to retrieve. This is a case-sensitive string representing the unique identifier of the variable within the model.- Returns:
- The
Nodeobject that represents the specified variable in the model. If no variable is found with the given name,nullis returned.
-
getKnowledge
Retrieves a copy of the current knowledge associated with this score wrapper. The copy ensures that the original knowledge remains unaltered by any external modifications.- Specified by:
getKnowledgein interfaceHasKnowledge- Returns:
- A copy of the current
Knowledgeobject.
-
setKnowledge
Sets the knowledge used by this score wrapper. The provided knowledge is copied to ensure that the original object remains unaltered.- Specified by:
setKnowledgein interfaceHasKnowledge- Parameters:
knowledge- TheKnowledgeobject to be set. Represents constraints, rules, or prior knowledge used in the scoring process.
-