Neural Net that analyzes and predicts the winner of basketball games.
- download python 3.7 as well as pip, 3.8 does not support tensor flow : https://www.python.org/downloads/
- cd brewdog-brewdogCapstone/backEnd/API/
- pip install Django
- pip install django-cors-headers
- pip install djangorestframework
- pip install django-common
- pip install numpy
- pip install tensorflow
- run local:
- python manage.py runserver
- run on server (make sure your aws instance has all ports opened and no firewalls setup)
- python manage.py runserver 0.0.0.0:8000
- Scrapes game logs from stats.nba.com to later be input into dataAverager.py then eventually to neural network. - Formats all data into .csv files which are found in teamGameLogs - Used to have extra functionality, but removed any code that wasn't being used in the current version of the project
- Averages totals of games played up until the given data
- Reformats data to later be input into the neural network.
- Data Format:
- game
- Team1 stats before game (array of 20 integer stats)
- Team2 stats before game (array of 20 integer stats)
- Winner of game is team 1 (boolean)
- game
- Defines the structure of the neural net, and trains it based on data from dataAverager.py
- Final Structure:
- Input Layer
- Learning layer : 40 nodes, rectified linear unit activation function
- Output layer
- Training:
- We trained many neural nets using this file the one we used for the API was trained using
- 1400 training games
- 70 test games
- 1000 epochs (times iterated over training games)
- brewdog Optimizer
- And achieved an accuracy of 57.4%
- We trained many neural nets using this file the one we used for the API was trained using
- Saves Neural Networks to be used later by the API
- Uses saved neural net in /myModels to predict on saved games in matchups.npy and then expose these predictions through an API listening on port 8000
- API Endpoints:
- /gamepredictions
- download node.js: https://nodejs.org/en/download/
- cd brewdog-brewdogCapstone/FrontEnd/bnann/
- npm install
- npm start
- Handles all of the frontend that is displayed other than the navigation bar (Home & About page)
- Contains all of the files needed to display and run the front end, also that link the frontend to the backend
- \brewdog-brewdogCapstone\FrontEnd\bnann\src\constants.js
- Make sure api is set to localhost if running locally