Class STDynamic


  • public final class STDynamic
    extends SubsetTrainConfig
    Specifies dynamic training of subsets. Immutable class. This subset training mode is recommended in most cases. It generates synthetic training examples by replacing empty scores with insertion scores and by replacing present scores that are within defined limits with empty scores. This minimizes the number of generated examples that are mislabeled. Different score replacement rules may be specified for each feature.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double INS_DEFAULT
      Use default insertion score.
      static double NO_CHANGE
      Do not insert/remove score.
    • Constructor Summary

      Constructors 
      Constructor Description
      STDynamic()
      Creates a Dynamic subset training configuration with default parameters.
      STDynamic​(double[] trueInsertScores, double[] falseInsertScores, double[] trueRemoveLimits, double[] falseRemoveLimits)
      Creates a Dynamic subset training configuration with specified parameters.
      STDynamic​(int nFeatures, double trueInsertScore, double falseInsertScore, double trueRemoveLimit, double falseRemoveLimit)
      Creates a Dynamic subset training configuration using the same value for each of the parameter arrays.
    • Field Detail

      • NO_CHANGE

        public static final double NO_CHANGE
        Do not insert/remove score. Can be used for any insertion score or removal limit.
        See Also:
        Constant Field Values
      • INS_DEFAULT

        public static final double INS_DEFAULT
        Use default insertion score. Can be used for any insertion score.
        See Also:
        Constant Field Values
    • Constructor Detail

      • STDynamic

        public STDynamic()
        Creates a Dynamic subset training configuration with default parameters.
      • STDynamic

        public STDynamic​(double[] trueInsertScores,
                         double[] falseInsertScores,
                         double[] trueRemoveLimits,
                         double[] falseRemoveLimits)
        Creates a Dynamic subset training configuration with specified parameters.
        Parameters:
        trueInsertScores - - Scores to insert into true-labeled vectors when filling in a missing score. Not null. This score should be close to 1.0. Must be between 0.0 and 1.0, or NO_CHANGE, or INS_DEFAULT.
        falseInsertScores - - Scores to insert into false-labeled vectors when filling in a missing score. Not null. This score should be close to 0.0. Must be between 0.0 and 1.0, or NO_CHANGE, or INS_DEFAULT.
        trueRemoveLimits - - Scores above this value will not be removed from true-labeled vectors. Not null. It is recommended this be no higher than 0.75. Must be between 0.0 and 1.0, or NO_CHANGE.
        falseRemoveLimits - - Scores below this value will not be removed from false-labeled vectors. Not null. It is recommended this be no lower than 0.50. Must be between 0.0 and 1.0, or NO_CHANGE.
        Throws:
        java.lang.IllegalArgumentException - if the arrays do not have the same length, or if any insert score or remove limit is invalid.
      • STDynamic

        public STDynamic​(int nFeatures,
                         double trueInsertScore,
                         double falseInsertScore,
                         double trueRemoveLimit,
                         double falseRemoveLimit)
        Creates a Dynamic subset training configuration using the same value for each of the parameter arrays. See STDynamic(double[], double[], double[], double[])
    • Method Detail

      • copy

        public SubsetTrainConfig copy()
        Description copied from class: SubsetTrainConfig
        Copies this object to a new object. Assumes that some subclasses may be mutable.
        Specified by:
        copy in class SubsetTrainConfig
        Returns:
        a deep copy of this object. An object of appropriate subclass is returned.
      • getDftInsertScore

        public static double getDftInsertScore​(boolean label)
        Returns:
        the default insertion score for training examples with the given label.
      • getDftRemoveLimit

        public static double getDftRemoveLimit​(boolean label)
        Returns:
        the default removal limit for training examples with the given label.
      • getTrueInsertScores

        public double[] getTrueInsertScores()
        Returns:
        the scores to insert into true-labeled vectors when filling in a missing score. Null if default scores are used.
      • getFalseInsertScores

        public double[] getFalseInsertScores()
        Returns:
        the scores to insert into false-labeled vectors when filling in a missing score. Null if default scores are used.
      • getTrueRemoveLimits

        public double[] getTrueRemoveLimits()
        Returns:
        the scores above which values will not be removed from true-labeled vectors. Null if default limits are used.
      • getFalseRemoveLimits

        public double[] getFalseRemoveLimits()
        Returns:
        the scores below which values will not be removed from false-labeled vectors. Null if default limits are used.