All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Interface weka.estimators.Estimator

public interface Estimator
extends 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.2 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Method Index

 o addValue(double, double)
Add a new data value to the current estimator.
 o getProbability(double)
Get a probability estimate for a value.

Methods

 o addValue
 public abstract 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
 o getProbability
 public abstract 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home