weka.estimators
Interface Estimator
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- NormalEstimator, PoissonEstimator, KernelEstimator, MahalanobisEstimator, DiscreteEstimator
- 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);
}
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
Method Summary |
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. |
addValue
public void addValue(double data,
double weight)
- Add a new data value to the current estimator.
- Parameters:
data
- the new data valueweight
- the weight assigned to the data value
getProbability
public 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