/** * Main method for testing this class. * * @param argv should contain a sequence of numeric values */ public static void main(String[] argv) { try { if (argv.length == 0) { System.out.println("Please specify a set of instances."); return; } NormalEstimator newEst = new NormalEstimator(0.01); for (int i = 0; i < argv.length; i++) { double current = Double.valueOf(argv[i]).doubleValue(); System.out.println(newEst); System.out.println("Prediction for " + current + " = " + newEst.getProbability(current)); newEst.addValue(current, 1); } NormalEstimator.testAggregation(); } catch (Exception e) { System.out.println(e.getMessage()); } } }
/** * Main method for testing this class. * * @param argv should contain a sequence of numeric values */ public static void main(String[] argv) { try { if (argv.length == 0) { System.out.println("Please specify a set of instances."); return; } NormalEstimator newEst = new NormalEstimator(0.01); for (int i = 0; i < argv.length; i++) { double current = Double.valueOf(argv[i]).doubleValue(); System.out.println(newEst); System.out.println("Prediction for " + current + " = " + newEst.getProbability(current)); newEst.addValue(current, 1); } NormalEstimator.testAggregation(); } catch (Exception e) { System.out.println(e.getMessage()); } } }