This is code to implement bots that predict Formula One results. The rules come from the prediction game at http://www.f1wolf.com/ . Currently there are three things implemented:
- A scraper which extracts race results from 2005-2011 from Wikipedia to an H2 embedded database
- A framework to write predictors
- A random predictor and my predictor
Uses commons.pdp7 from https://github.com/alexpdp7/commons.pdp7
Checkout URL: git@github.com:alexpdp7/commons.pdp7.git
Readonly: git://github.com/alexpdp7/commons.pdp7.git
You can find it in net.pdp7.f1.prediction.scraper.WikipediaScraper . It uses HTMLUnit and it’s fairly simple; fortunately results formatting in Wikipedia are fairly stable. It writes to a database with this schema .
There are some tests in the test folder which you can use to store scraping results in an H2 file.
It’s located in net.pdp7.f1.prediction.predictors
It has:
- Predictor , which contains the main predictor interface and
Prediction
andEntrant
nested classes (anEntrant
is a driver/team pairing). APredictor
returns aPrediction
based on aList
of @Entrant@s, and which race it is (season, round, circuit). - PredictionScorer, which evaluates a
Prediction
according to the contest rules - PredictorPastEvaluator which runs a Predictor against all scraped results and evaluates it
We have RandomPredictor which is well, random… and my predictor , which uses past results to make a prediction.
Take a look at the tests for ways to work with your own @Predictor@s.