SouthridgeCorp / player-outcome-predictor

Predictive modeling to forecast player outcomes over a T20 tournament
MIT License
0 stars 0 forks source link

player-outcome-predictor

Predictive modeling to forecast player outcomes over a T20 tournament

Video Walkthrough of v1.0

Getting the data ready

Before running the app, input data must be prepared:

Setting up configuration for a deployment

Config.toml

Secrets.toml

IMPORTANT: Credentials in Secrets must never be checked in and always maintained as local edits

For Local Feedback

Please touch .streamlit/secrets.toml (but can leave it blank)

For Google

You can directly read from the link or read below:

# .streamlit/secrets.toml

private_gsheets_url = "https://docs.google.com/spreadsheets/d/12345/edit?usp=sharing"

[gcp_service_account]
type = "service_account"
project_id = "xxx"
private_key_id = "xxx"
private_key = "xxx"
client_email = "xxx"
client_id = "xxx"
auth_uri = "https://accounts.google.com/o/oauth2/auth"
token_uri = "https://oauth2.googleapis.com/token"
auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs"
client_x509_cert_url = "xxx"
For Snowflake

Contact Gireesh to configure Snowflake access

Setting up the virtual environment using docker

Run the streamlit application locally with docker

Run the streamlit application locally without docker

Host the streamlit application externally

Retrieve and investigate available feedback

Repo Structure

project
│   README.md [technical readme for this repo]
│   working_backwards.md [working backwards questions for the product]
│   press_release.md [press release for the product]
│   faq.md [faq for the product]
│   requirements.txt [python library dependecies for this repo]
│   app.py [streamlit app for this repo]
│   
└───.FDm [sample toml files which can be used to configure the app]   
│   
└───data [ignored by git, repo for data generated by the app]   
│   
└───resources [version controlled data folder]
│   └───test [folder to locate data for test cases]
│   └───working_backwards [folder with content to be served for working backwards]
│   └───press_release [folder with content to be served for press_relase]
│   └───faq [folder with content to be served for faq]
│   └───computational_model [folder with content to be served for computational model]
│   └───architecture_hypothesis [folder with content to be served for architecture_hypothesis] 
│   
└───pages [python module for hosting all pages of the streamlit application]
    │   1_📋_About.py [serves resources/press_release]
    │   2_📋_Data_Selection.py 
    │   3_📋_Configure_Sportiqo_Rewards.py
    │   4_📋_Review_Perfect_Simulation.py
    │   5_📋_Review_Inferential_Models.py
    │   6_📋_Review_Predictive_Simulations.py
    │   7_📋_Simulate_Tournament.py
    │   8_📋_FAQ.py [serves resources/faq and resources/working_backwards]
    │   9_📋_Architecture_Hypothesis.py [serves resources/architecture_hypothesis]
    │   10_📋_Computational_Model.py [serves resources/computational_model]
    │   11_📋_Feedback.py [serves page to collect feedback]
│   
└───historical_data [python module for serving historical_data]
└───data_selection [python module for serving data_selections]
└───rewards_configuration [python module for configuring rewards formula]
└───simulators [python module for simulators]
    └───perfect_simulator [python module for perfect simulator]
    └───predictive_simulator [python module for predictive simulator]
    └───tournament_simulator [python module for tournament simulator]
└───inferential_models [python module for inferential models]
    └───bowling_outcomes_models [python module for inferential models that classify bowling_outcomes]
        └───first_innings_by_ball_model [python module for inferential models that operate on the first innings at the ball resolution]
        └───second_innings_by_ball_model [python module for inferential models that operate on the second innings at the ball resolution]
│   
└───utils [python module for serving configuration from schemas]
    │   graph_utils.py [utility functions for rendering mermaid graphs]
    │   page_utils.py [utility functions for rendering streamlit tab pages]
    │   config_utils.py [business logic for the module]
│   
└───test [python module with all test cases]

Running Tests

pytest test