Coder Social home page Coder Social logo

nba-predict's Introduction

NBA-Predict

Predicts NBA Games Using a Logistic Regression Model in Python

Model

The model uses eight factors scraped from stats.nba.com to determine the predicted result of an NBA game. Each stat is adjusted to per 100 possessions to ensure pace has no impact on the predictions.

  • Home Team
  • Win Percentage
  • Rebounds
  • Turnovers
  • Plus Minus
  • Offensive Rating
  • Defensive Rating
  • True Shooting Percentage

Usage

Installation

pip3 install -r requirements.txt

Daily Predictions

  1. Open nbaPredict.py
  2. Edit the call to makeInterpretPrediction with desired date of games, season, and the start date of the season NBA-Predict Image
  3. Run the program either through the terminal or an IDE
  4. Wait ~1-3 minutes for model to finish scraping stats and predicting outcomes
  5. Outcomes are outputted as the percent chance that the home team will defeat the away team Screen Shot 2019-08-01 at 5 41 22 PM

Past Predictions

  1. Open makePastPredictions.py

  2. Edit the call to makePastPredictions with desired start date, end date, season, start date of the season, and output filenames. NOTE: The start date should be at least three days after the season begins and the end date is non-inclusive.

    Screen Shot 2019-10-11 at 1 41 42 AM

  3. Run the program either through the terminal or an IDE

  4. Two CSV files will be saved in the Data folder. One holds the gameData and the other holds the predictions for the games. The time to execute will vary greatly from a couple minutes to a several hours depending on the range between the start and end date.

Accuracy Information

Confusion Matrix

rsz_1confusionmatrix

Accuracy: 0.7037 (532/756)

Precision: 0.7367 (375/509)

Recall: 0.8065 (375/465)

nba-predict's People

Contributors

jakekandell avatar patrickjmcd 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.