Class WithValueBase<T extends FeatureInput>

Type Parameters:
T - the type of FeatureInput this feature operates on
Direct Known Subclasses:
AddConstantTo, ConstantToThePowerOf, DivideByConstant, MultiplyByConstant, ReplaceUnusualValue, SubtractFrom, ToThePowerOfConstant

public abstract class WithValueBase<T extends FeatureInput> extends FeatureUnaryGeneric<T>
A base class for operations that use a specified constant value in combination with a feature.

This abstract class extends FeatureUnaryGeneric to provide a framework for combining a constant value with the result of a feature calculation.

  • Constructor Details

    • WithValueBase

      public WithValueBase()
  • Method Details

    • calculate

      public double calculate(FeatureCalculationInput<T> input) throws FeatureCalculationException
      Description copied from class: Feature
      Calculates a value for some input.
      Specified by:
      calculate in class Feature<T extends FeatureInput>
      Parameters:
      input - the input to the calculation.
      Returns:
      the result of the calculation.
      Throws:
      FeatureCalculationException - if the calculation cannot successfully complete.
    • descriptionLong

      public String descriptionLong()
      Description copied from class: Feature
      A long human-readable description of the feature and some or all of its parameterization.

      This can be overwritten to create an alternative description for features. By default string returned by Feature.describeBean() is used.

      Overrides:
      descriptionLong in class Feature<T extends FeatureInput>
      Returns:
      the description.
    • combineValueAndFeature

      protected abstract double combineValueAndFeature(double value, double featureResult)
      Combines the constant value with the feature result.
      Parameters:
      value - the constant value specified for this operation
      featureResult - the result of the feature calculation
      Returns:
      the combined result
    • combineDescription

      protected abstract String combineDescription(String valueDescription, String featureDescription)
      Combines the descriptions of the constant value and the feature.
      Parameters:
      valueDescription - the description of the constant value
      featureDescription - the description of the feature
      Returns:
      the combined description
    • getValue

      public double getValue()
      The constant value to be used in the operation. Default value is 0.
    • setValue

      public void setValue(double value)
      The constant value to be used in the operation. Default value is 0.