Giter VIP home page Giter VIP logo

afl-crowd-analytics's Introduction

AFL-Crowd-Analytics

This project was created to build a machine learning model to predict Australian Football League (AFL) attendances using historical data.

Two articles have been posted to Medium:

The Data

Three sources of data were used in the project:

  1. AFL Tables was used as the primary source of information. This is no doubt the go to for anyone looking at doing AFL analysis
  2. Australian Sports Betting was used to get betting data for matches from the 2013 season
  3. Australian Bureau of Meteorology was used for climat data (rain and temperature). Part of the scraper for BOM data was taken from James Day's fitzRoy R package. Big thanks to him.

Packages Used

  • rvest
  • httr
  • dplyr
  • stringr
  • tidyr
  • lubridate
  • tidyverse
  • car
  • MASS
  • readxl

To Reproduce The Analysis

Functions have been created to colect both sources of data:

  • afl_scraper.R goes and scrapes eihter a single season, or a range of seasons.
  • return_betting_data.R downloads the betting data xlsx file and does some preprocessing steps
  • get_bom_data.R extracts rain and temperature data and fills in missing values. Missing rain figures are averaged out with the next available reading, while missing temperatures are given that months averag min and max temp.

Then to scrape and save the files to csv, run src/get_afl_data.R.

If existing data in this repo is enough, simply run src/preprocessing.R to go thorough the preprocessing steps to get the data ready for the analysis in the Medium posts.

afl-crowd-analytics's People

Contributors

jaseziv avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.