Code Monkey home page Code Monkey logo

agarwalrohan189 / nba_match_prediction Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 16.02 MB

The NBA game prediction using multiple classifiers and multiple feature sets along with a comparative analysis of the same. Web scraping techniques are used to scrap around the past 10 years data from the official nba/stats website to perform feature engineering for the classification problem.

Python 100.00%
webscraping beautifulsoup4 selenium neural-network svm-classifier logistic-regression nba-stats nba-prediction

nba_match_prediction's Introduction

Prediction of NBA Games Using Machine Learning

Folder Contents:

'data' Folder:

File Content
PlayerScheduleXX-XX.csv Raw Player Box Scores
schedule.csv Raw Team Box Scores
NBAGameDataset.csv NBA Game Features Dataset

'src' Folder:-

File Content
webScraping.py Web Scraping script
featureEngineering.py Raw Data to Features Script
player.py Model training and testing on Players Statistics
team.py Model training and testing on Team Statistics
teamAndPlayer.py Model training and testing on Combined Team and Players Statistics

Note:- All the required libraries are mentioned in 'requirements.txt' and can be directly pip installed.

Web Scraping

Run python script 'webscraping.py' to scrap raw data from websites. This will generate a lot of csv files of raw data. This will take a lot of time as the pages are dynamically loaded and javascript clicking, and others are done by script. All the csv files are already in the data folder.

>> python3 ./src/webscraping.py

Feature Engineering

Run python script 'featureEngineering.py' to generate features from raw data. This will take around 10 minutes to run. The final csv dataset is already in the data folder with the name "NBAGameDataset.csv".

>> python3 ./src/featureEngineering.py

Running Models:-

Hyperparamter tuning code is commented as it takes hours to run. The models with tuned hyperparameters is added at the end of the scipt so that you can get the results faster. The models will load the csv from data folder.

To see results when models were feeded only team features:- run python script 'team.py'

>> python3 team.py

To see results when models were feeded only player features:- run python script 'player.py'

>> python3 player.py

To see results when models were feeded both team and player features:- run python script 'teamAndPlayer.py'

>> python3 teamAndPlayer.py

Note: The coorelation matrix has been commented out because it gives error on running from command line. In case if you want to try that code on notebook, please have matplotlib library installed.

nba_match_prediction's People

Contributors

agarwalrohan189 avatar

Watchers

 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.