Class FeatureHistogramStatistic

Direct Known Subclasses:
CoefficientOfVariation, Count, Kurtosis, Maximum, Mean, MeanRaisedToPower, Median, Minimum, Mode, NumberDistinctValues, Quantile, Range, RatioNonMode, RatioThreshold, Skewness, StandardDeviation, Sum, TotalCount, Variance

public abstract class FeatureHistogramStatistic extends FeatureHistogram
Base class for FeatureHistogram implementations that calculate a statistic from the Histogram.
Author:
Owen Feehan
  • Constructor Details

    • FeatureHistogramStatistic

      public FeatureHistogramStatistic()
  • Method Details

    • calculate

      Description copied from class: Feature
      Calculates a value for some input.
      Specified by:
      calculate in class Feature<FeatureInputHistogram>
      Parameters:
      input - the input to the calculation.
      Returns:
      the result of the calculation.
      Throws:
      FeatureCalculationException - if the calculation cannot successfully complete.
    • calculateStatisticFrom

      protected abstract double calculateStatisticFrom(Histogram histogram) throws FeatureCalculationException
      Calculates the statistic from the histogram, that is subsequently returned as the feature-value.
      Parameters:
      histogram - the histogram to calculate the statistic from.
      Returns:
      the calculated statistic.
      Throws:
      FeatureCalculationException - if the calculation cannot succeed.
    • isExceptionIfEmpty

      public boolean isExceptionIfEmpty()
      If true, then an exception is thrown if the histogram is empty, otherwise valueIfEmpty is returned.
    • setExceptionIfEmpty

      public void setExceptionIfEmpty(boolean exceptionIfEmpty)
      If true, then an exception is thrown if the histogram is empty, otherwise valueIfEmpty is returned.
    • getValueIfEmpty

      public double getValueIfEmpty()
      The value to return iff exceptionifEmpty is false.
    • setValueIfEmpty

      public void setValueIfEmpty(double valueIfEmpty)
      The value to return iff exceptionifEmpty is false.