Class IntervalEstimatorBased

  • All Implemented Interfaces:
    CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, Serializable

    public class IntervalEstimatorBased
    extends AbstractCrossvalidatedInstanceEvaluator<IntervalEstimatorBased.SortedInterval>
    Uses a classifier that produces confidence intervals. ???

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to
        the console (0 = off).
        default: 0
        minimum: 0
     
    -threshold <double> (property: threshold)
        The threshold percentage to use (0-1).
        default: 0.75
     
    -folds <int> (property: folds)
        The number of folds to use for cross-validation; cross-validation gets turned
        off below a value of 2.
        default: 2
     
    -seed <int> (property: seed)
        The seed value for randomizing the data for cross-validation.
        default: 1
     
    -classifier <weka.classifiers.Classifier [options]> (property: classifier)
        The classifier to use (must implement weka.classifiers.IntervalEstimator
        ).
        default: weka.classifiers.functions.GaussianProcesses -L 1.0 -N 0 -K \"weka.classifiers.functions.supportVector.PolyKernel -C 250007 -E 1.0\"
     
    -level <double> (property: confidenceLevel)
        The confidence level to use when generating the confidence intervals (0-
        1).
        default: 0.95
     
    -relative (property: relativeWidths)
        If set to true, then the calculated widths will be relative ones, as they
        will get divided by the class value of the Instance.
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Classifier

        protected weka.classifiers.Classifier m_Classifier
        the IntervalEstimator to use.
      • m_ConfidenceLevel

        protected double m_ConfidenceLevel
        the confidence level.
      • m_RelativeWidths

        protected boolean m_RelativeWidths
        whether to divide the calculated widths by the class value.
      • m_MaxWidth

        protected double m_MaxWidth
        the maximum width allowed.
      • m_MinWidth

        protected double m_MinWidth
        the minimum width encountered.
    • Constructor Detail

      • IntervalEstimatorBased

        public IntervalEstimatorBased()
    • Method Detail

      • setClassifier

        public void setClassifier​(weka.classifiers.Classifier value)
        Sets the classifier to use, must implement weka.classifiers.IntervalEstimator.
        Parameters:
        value - the classifier
      • getClassifier

        public weka.classifiers.Classifier getClassifier()
        Returns the classifier.
        Returns:
        the classifier
      • classifierTipText

        public String classifierTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setConfidenceLevel

        public void setConfidenceLevel​(double value)
        Sets the confidence level.
        Parameters:
        value - the confidence level (0-1)
      • getConfidenceLevel

        public double getConfidenceLevel()
        Returns the confidence level.
        Returns:
        the confidence level (0-1)
      • confidenceLevelTipText

        public String confidenceLevelTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setRelativeWidths

        public void setRelativeWidths​(boolean value)
        Sets whether to divide the calculated widths by the class value.
        Parameters:
        value - if true then the widths will get divided by the class value (= relative)
      • getRelativeWidths

        public boolean getRelativeWidths()
        Returns whether the calculated widths are divided by the class value.
        Returns:
        trye if the widths are divided by the class value
      • relativeWidthsTipText

        public String relativeWidthsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doEvaluate

        protected double doEvaluate​(weka.core.Instance inst)
        Performs the actual evaluation.
        Specified by:
        doEvaluate in class AbstractInstanceEvaluator
        Parameters:
        inst - the instance to evaluate
        Returns:
        evaluation range, between 0 and 1 (0 = bad, 1 = good, -1 = if unable to evaluate)
      • calcWidth

        protected static double calcWidth​(double[] array)
        Calculates the width of the interval.
        Parameters:
        array - the lower and upper bound
        Returns:
        the width
      • calcAverageWidth

        protected static double calcAverageWidth​(double[][] array)
        Calculates the average width of the intervals.
        Parameters:
        array - the arrayw with the lower and upper bounds
        Returns:
        the average width