This project aims to to predict the NBA's Most Valuable Player (MVP) for the current season. This README is a description of how to create, activate, and install all Python requirements in a virtual environment, it also provides instructions on deploying a flow with the Prefect CLI.
To manage Python packages and ensure project dependencies are isolated, it is recommended to use a virtual environment. Follow these steps to set up a virtual environment:
-
Install
virtualenv
if you haven't already:$ python3 -m venv .venv
-
Create a new virtual environment:
$ virtualenv .venv
-
Activate the virtual environment:
-
For Windows:
$ .\.venv\Scripts\Activate.ps1
-
For Unix/Linux:
$ source .venv/bin/activate
-
Once the virtual environment is set up and activated, proceed to install the Python requirements for this project. Typically, these requirements are specified in a requirements.txt
file.
-
Navigate to the project directory.
-
Install the requirements:
$ pip install -r requirements.txt
To deploy a flow using the Prefect CLI, follow these steps:
-
Ensure that Prefect is installed:
$ pip install prefect
-
Authenticate with the Prefect server:
# This authenticates to an already created Prefect Cloud account $ prefect cloud login --key <API_KEY>
-
Create a flow file (e.g.,
flow.py
) with the desired flow definition. -
Build the flow deployment configuration (
.yaml
) file:$ prefect deployment build ".\flow.py:function" \ --name "Flow Deployment Name" \ --tag "tag-1" --tag "tag-2" \ --pool default-agent-pool \ --work-queue default \ --infra process \ --storage-block your_prefect_block \ --cron "cron expression" \ --output "./src/nba-etl-deployment.yaml"
-
Apply flow deployment:
$ prefect deployment apply "./src/nba-etl-deployment.yaml"
For more information on using the Prefect CLI, refer to the Prefect documentation.
That's it! You have now learned how to create and activate a virtual environment, install Python requirements, and deploy a flow using the Prefect CLI for predicting the NBA's Most Valuable Player. Enjoy the journey of MVP prediction using machine learning!