Class RangeCheckHelper


  • public class RangeCheckHelper
    extends Object
    Helper class for generating range checks.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • RangeCheckHelper

        public RangeCheckHelper()
    • Method Detail

      • computePercentage

        protected static String computePercentage​(double value,
                                                  double min,
                                                  double max)
        Calculates the percentage of how much the value is outside the range.
        Parameters:
        value - the value to calculate the percentage for
        min - the minimum of the range
        max - the maximum of the range
        Returns:
        the generated string
      • isOutside

        public static String isOutside​(weka.core.Instance inst,
                                       int attIndex,
                                       double min,
                                       double max)
        Performs a check for the given instance, whether it exceeds the range. The attribute must be numeric.
        Parameters:
        inst - the instance to check
        attIndex - the attribute to check
        min - the minimum of the range (incl)
        max - the maximum of the range (excl)
        Returns:
        null if not outside, otherwise error message