Interface Estimator

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    KernelEstimator

    public interface Estimator
    extends java.io.Serializable
    Interface for probability estimators. Example code:

       // Create a discrete estimator that takes values 0 to 9
       DiscreteEstimator newEst = new DiscreteEstimator(10, true);
    
       // Create 50 random integers first predicting the probability of the
       // value, then adding the value to the estimator
       Random r = new Random(seed);
       for(int i = 0; i < 50; i++) {
         current = Math.abs(r.nextInt() % 10);
         System.out.println(newEst);
         System.out.println("Prediction for " + current 
                            + " = " + newEst.getProbability(current));
         newEst.addValue(current, 1);
       }
     
    Version:
    $Revision: 1.5 $
    Author:
    Len Trigg (trigg@cs.waikato.ac.nz)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addValue​(double data, double weight)
      Add a new data value to the current estimator.
      double getProbability​(double data)
      Get a probability estimate for a value.
    • Method Detail

      • addValue

        void addValue​(double data,
                      double weight)
        Add a new data value to the current estimator.
        Parameters:
        data - the new data value
        weight - the weight assigned to the data value
      • getProbability

        double getProbability​(double data)
        Get a probability estimate for a value.
        Parameters:
        data - the value to estimate the probability of
        Returns:
        the estimated probability of the supplied value