Class ReplaceUnusualValue<T extends FeatureInput>

Type Parameters:
T - the type of FeatureInput this feature operates on
Direct Known Subclasses:
ReplaceInfinity, ReplaceNaN

public abstract class ReplaceUnusualValue<T extends FeatureInput> extends WithValueBase<T>
Calculates the underlying feature, but replaces the result with a constant if it is an "unusual" value.

This abstract class extends WithValueBase to provide a mechanism for replacing specific unusual values (e.g., NaN, Infinity) in feature calculation results with a predefined constant.

  • Constructor Details

    • ReplaceUnusualValue

      public ReplaceUnusualValue()
  • Method Details

    • combineValueAndFeature

      protected double combineValueAndFeature(double value, double featureResult)
      Description copied from class: WithValueBase
      Combines the constant value with the feature result.
      Specified by:
      combineValueAndFeature in class WithValueBase<T extends FeatureInput>
      Parameters:
      value - the constant value specified for this operation
      featureResult - the result of the feature calculation
      Returns:
      the combined result
    • combineDescription

      protected String combineDescription(String valueDescription, String featureDescription)
      Description copied from class: WithValueBase
      Combines the descriptions of the constant value and the feature.
      Specified by:
      combineDescription in class WithValueBase<T extends FeatureInput>
      Parameters:
      valueDescription - the description of the constant value
      featureDescription - the description of the feature
      Returns:
      the combined description
    • isResultUnusual

      protected abstract boolean isResultUnusual(double featureResult)
      Determines if the feature result is considered unusual and should be replaced.
      Parameters:
      featureResult - the result of the feature calculation
      Returns:
      true if the result is unusual and should be replaced, false otherwise