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:
  • 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

      public Score getScore(DataModel dataModel, Parameters parameters)
      Computes the score for a given data model and set of parameters.
      Specified by:
      getScore in interface ScoreWrapper
      Parameters:
      dataModel - The data model, which must be a continuous DataSet. If an invalid data model is provided, an IllegalArgumentException is 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 Score object 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

      public String getDescription()
      Provides a description of the scoring method used in this class.
      Specified by:
      getDescription in interface ScoreWrapper
      Returns:
      A string describing the scoring method as "Instance-Augmented SEM-BIC (continuous)".
    • getDataType

      public DataType getDataType()
      Returns the data type associated with this scoring method.
      Specified by:
      getDataType in interface ScoreWrapper
      Returns:
      The data type, which is DataType.Continuous.
    • getParameters

      public List<String> 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:
      getParameters in interface HasParameters
      Specified by:
      getParameters in interface ScoreWrapper
      Returns:
      A list of parameter names, including instance-specific alpha, instance row index, and the penalty discount.
    • getVariable

      public Node getVariable(String name)
      Retrieves a variable node by its name.
      Specified by:
      getVariable in interface ScoreWrapper
      Parameters:
      name - The name of the variable to retrieve.
      Returns:
      The Node corresponding to the specified variable name, or null if no such variable exists.
    • getKnowledge

      public Knowledge getKnowledge()
      Retrieves the knowledge associated with this instance.
      Specified by:
      getKnowledge in interface HasKnowledge
      Returns:
      The Knowledge object encapsulating the domain-specific constraints or background knowledge for the current instance.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the knowledge associated with this instance. The provided Knowledge object is copied to ensure that modifications to the original object do not affect this instance's knowledge.
      Specified by:
      setKnowledge in interface HasKnowledge
      Parameters:
      knowledge - The Knowledge object encapsulating the domain-specific constraints or background knowledge. This cannot be null. If null, an appropriate exception or error handling may be triggered (depending on implementation).