Record Class MissingnessIndicatorAdder.Spec

java.lang.Object
java.lang.Record
edu.cmu.tetrad.search.utils.MissingnessIndicatorAdder.Spec
Record Components:
minRate - Minimum missingness rate for a variable to get an indicator.
maxRate - Maximum missingness rate for a variable to get an indicator.
discreteIndicators - If true, indicators are binary discrete variables with categories "observed" and "missing"; if false, continuous 0/1 columns.
attachKnowledge - If true, knowledge is attached to the result placing the substantive variables in tier 0 and the indicators in tier 1, so that no indicator can be a cause of a substantive variable.
forbidSelfMasking - If true, and knowledge is attached, the edge from each variable to its own indicator is forbidden, since it cannot be scored from the observed cases.
suffix - Suffix appended to the variable name to form the indicator name.
Enclosing class:
MissingnessIndicatorAdder

public static record MissingnessIndicatorAdder.Spec(double minRate, double maxRate, boolean discreteIndicators, boolean attachKnowledge, boolean forbidSelfMasking, String suffix) extends Record
Options controlling which indicators are added and what is attached to the result.
Author:
josephramsey
  • Constructor Details

    • Spec

      public Spec(double minRate, double maxRate, boolean discreteIndicators, boolean attachKnowledge, boolean forbidSelfMasking, String suffix)
      Canonical constructor, with validation.
  • Method Details

    • defaults

      public static MissingnessIndicatorAdder.Spec defaults()
      Returns the default spec: discrete indicators for every variable whose missingness rate lies between 0.02 and 0.98, with tier knowledge attached and self-masking forbidden.
      Returns:
      the default spec.
    • withRateWindow

      public MissingnessIndicatorAdder.Spec withRateWindow(double minRate, double maxRate)
      Returns a copy of this spec with the given rate window.
      Parameters:
      minRate - the minimum rate.
      maxRate - the maximum rate.
      Returns:
      the modified copy.
    • withDiscreteIndicators

      public MissingnessIndicatorAdder.Spec withDiscreteIndicators(boolean discrete)
      Returns a copy of this spec with the given indicator type.
      Parameters:
      discrete - true for discrete indicators, false for continuous 0/1 columns.
      Returns:
      the modified copy.
    • withKnowledge

      public MissingnessIndicatorAdder.Spec withKnowledge(boolean attach, boolean forbidSelfMasking)
      Returns a copy of this spec with the given knowledge settings.
      Parameters:
      attach - whether to attach tier knowledge.
      forbidSelfMasking - whether to forbid each variable to cause its own indicator.
      Returns:
      the modified copy.
    • withSuffix

      public MissingnessIndicatorAdder.Spec withSuffix(String suffix)
      Returns a copy of this spec with the given indicator name suffix.
      Parameters:
      suffix - the suffix.
      Returns:
      the modified copy.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • minRate

      public double minRate()
      Returns the value of the minRate record component.
      Returns:
      the value of the minRate record component
    • maxRate

      public double maxRate()
      Returns the value of the maxRate record component.
      Returns:
      the value of the maxRate record component
    • discreteIndicators

      public boolean discreteIndicators()
      Returns the value of the discreteIndicators record component.
      Returns:
      the value of the discreteIndicators record component
    • attachKnowledge

      public boolean attachKnowledge()
      Returns the value of the attachKnowledge record component.
      Returns:
      the value of the attachKnowledge record component
    • forbidSelfMasking

      public boolean forbidSelfMasking()
      Returns the value of the forbidSelfMasking record component.
      Returns:
      the value of the forbidSelfMasking record component
    • suffix

      public String suffix()
      Returns the value of the suffix record component.
      Returns:
      the value of the suffix record component