No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
f1.prediction
README.textile

README.textile

f1.prediction

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

Dependencies

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

The scraper

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.

The framework

It’s located in net.pdp7.f1.prediction.predictors

It has:

  • Predictor , which contains the main predictor interface and Prediction and Entrant nested classes (an Entrant is a driver/team pairing). A Predictor returns a Prediction based on a List 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

The scrapers

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.