All Packages Class Hierarchy This Package Previous Next Index WEKA's home
// 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);
}
public abstract void addValue(double data, double weight)
public abstract double getProbability(double data)
All Packages Class Hierarchy This Package Previous Next Index WEKA's home