Created
November 23, 2011 20:24
-
-
Save sanity/1389799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final LinkedList<PredictionCalibrator.Prediction> predictions = Lists.newLinkedList(); | |
for (int x = 0; x < 10000; x++) { | |
final double prediction = Misc.random.nextDouble(); | |
final double outcome = (Misc.random.nextDouble() < Math.pow(prediction, 2)) ? 1.0 : 0.0; | |
predictions.add(new Prediction(prediction, outcome)); | |
} | |
final PredictionCalibrator pc = new PredictionCalibrator(predictions); | |
for (final Prediction p : pc.calibrationSet) { | |
System.out.println(p.prediction + "\t" + p.outcome); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment