Class InstanceAugmentedSemBicScoreWrapper
java.lang.Object
edu.cmu.tetrad.algcomparison.score.InstanceAugmentedSemBicScoreWrapper
- All Implemented Interfaces:
ScoreWrapper,HasKnowledge,HasParameters,TetradSerializable,Serializable
@Score(name="Instance-specific Augmented Sem BIC Score",
command="is-sem-bic-score",
dataType={Continuous,Covariance})
public final class InstanceAugmentedSemBicScoreWrapper
extends Object
implements ScoreWrapper, HasKnowledge
Wrapper for InstanceAugmentedSemBicScore that: - pulls the testing DataSet from Params.TESTING_DATA (injected by the
algorithm wrapper), - takes the instance row from Params.INSTANCE_ROW, - aligns columns by training variable names, -
uses alpha from Params.IS_ALPHA (default 1.0).
- See Also:
-
Field Summary
Fields inherited from interface edu.cmu.tetrad.algcomparison.score.ScoreWrapper
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance of the `InstanceAugmentedSemBicScoreWrapper` class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the data type associated with this scoring method.Provides a description of the scoring method used in this class.Retrieves the knowledge associated with this instance.Retrieves a list of parameter names required by the scoring method.getScore(DataModel dataModel, Parameters parameters) Computes the score for a given data model and set of parameters.getVariable(String name) Retrieves a variable node by its name.voidsetKnowledge(Knowledge knowledge) Sets the knowledge associated with this instance.
-
Constructor Details
-
InstanceAugmentedSemBicScoreWrapper
public InstanceAugmentedSemBicScoreWrapper()Constructs a new instance of the `InstanceAugmentedSemBicScoreWrapper` class. This class serves as a wrapper for computing scores based on the "Instance-Augmented SEM-BIC" method for continuous data. It provides extended functionality for handling instance-specific parameters and supports integration with scoring frameworks.
-
-
Method Details
-
getScore
Computes the score for a given data model and set of parameters.- Specified by:
getScorein interfaceScoreWrapper- Parameters:
dataModel- The data model, which must be a continuousDataSet. If an invalid data model is provided, anIllegalArgumentExceptionis thrown.parameters- The parameters used for configuring the score computation, including instance-specific alpha, instance row index, and penalty discount (optional). The row index must be within the range of rows for the testing data or training data being used.- Returns:
- A
Scoreobject representing the computed instance-augmented score. - Throws:
IllegalArgumentException- If the data model is not continuous, the testing data is not continuous, or the instance row index is out of range.
-
getDescription
Provides a description of the scoring method used in this class.- Specified by:
getDescriptionin interfaceScoreWrapper- Returns:
- A string describing the scoring method as "Instance-Augmented SEM-BIC (continuous)".
-
getDataType
Returns the data type associated with this scoring method.- Specified by:
getDataTypein interfaceScoreWrapper- Returns:
- The data type, which is
DataType.Continuous.
-
getParameters
Retrieves a list of parameter names required by the scoring method. The parameters include specific settings necessary for configuring the instance-augmented scoring process.- Specified by:
getParametersin interfaceHasParameters- Specified by:
getParametersin interfaceScoreWrapper- Returns:
- A list of parameter names, including instance-specific alpha, instance row index, and the penalty discount.
-
getVariable
Retrieves a variable node by its name.- Specified by:
getVariablein interfaceScoreWrapper- Parameters:
name- The name of the variable to retrieve.- Returns:
- The
Nodecorresponding to the specified variable name, ornullif no such variable exists.
-
getKnowledge
Retrieves the knowledge associated with this instance.- Specified by:
getKnowledgein interfaceHasKnowledge- Returns:
- The
Knowledgeobject encapsulating the domain-specific constraints or background knowledge for the current instance.
-
setKnowledge
Sets the knowledge associated with this instance. The providedKnowledgeobject is copied to ensure that modifications to the original object do not affect this instance's knowledge.- Specified by:
setKnowledgein interfaceHasKnowledge- Parameters:
knowledge- TheKnowledgeobject encapsulating the domain-specific constraints or background knowledge. This cannot benull. Ifnull, an appropriate exception or error handling may be triggered (depending on implementation).
-