Skip to main content

Batch Prediction Pipeline

Check out this Medium article for more details about this module.

Create Environment File

~/energy-forecasting $ cp .env.default .env

The command cp .env.default .env is used to create a copy of the .env.default file and name it .env. In many projects, the .env file is used to store environment variables that the application needs to run. The .env.default file is usually a template that includes all the environment variables that the application expects, but with default values. By copying it to .env, you can customize these values for your own environment.

Set Up the ML_PIPELINE_ROOT_DIR Variable

~/energy-forecasting $ export ML_PIPELINE_ROOT_DIR=$(pwd)

The command export ML_PIPELINE_ROOT_DIR=$(pwd) is setting the value of the ML_PIPELINE_ROOT_DIR environment variable to the current directory. In this context, $(pwd) is a command substitution that gets replaced with the output of the pwd command, which prints the path of the current directory. The export command then makes this variable available to child processes of the current shell.

In essence, ML_PIPELINE_ROOT_DIR is an environment variable that is set to the path of the current directory. This can be useful for scripts or programs that need to reference the root directory of the ML pipeline, as they can simply refer to ML_PIPELINE_ROOT_DIR instead of needing to know the exact path.

Install for Development

The batch prediction pipeline uses the training pipeline module as a dependency. Thus, as a first step, we must ensure that the training pipeline module is published to our private PyPi server.

NOTE: Make sure that your private PyPi server is running. Check the Usage section if it isn't.

Build & publish the training-pipeline to your private PyPi server:

cd training-pipeline
poetry build
poetry publish -r my-pypi
cd ..

Install the virtual environment for batch-prediction-pipeline:

~/energy-forecasting                           $ cd batch-prediction-pipeline && rm poetry.lock
~/energy-forecasting/batch-prediction-pipeline $ bash ../scripts/devops/virtual_environment/poetry_install.sh
~/energy-forecasting/batch-prediction-pipeline $ source .venv/bin/activate

Check the Set Up Additional Tools and Usage sections to see how to set up the additional tools and credentials you need to run this project.

Usage for Development

To start batch prediction script, run:

~/energy-forecasting/batch-prediction-pipeline $ python -m batch_prediction_pipeline.batch

To compute the monitoring metrics based, run the following:

~/energy-forecasting/batch-prediction-pipeline $ python -m batch_prediction_pipeline.monitoring

NOTE: Be careful to set the ML_PIPELINE_ROOT_DIR variable as explained in this section.

Release files for g-batch-prediction-pipeline 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for g-batch-prediction-pipeline 0.3.0
File Size Uploaded
g_batch_prediction_pipeline-0.3.0.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for g-batch-prediction-pipeline 0.3.0
File Interpreter ABI Platform
g_batch_prediction_pipeline-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / g_batch_prediction_pipeline-0.3.0.tar.gz

Download URL g_batch_prediction_pipeline-0.3.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8ca12b4ccb1ab76143baf9b06881b44ca9536bf42f8ef5269086e7ae1aab1f9d
BLAKE2b-256 checksum
How to use checksums
36c594af2522bccee57b02e6b79fb18b8363ee19b0775e54494ede274a3f4d9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.9 Darwin/22.3.0

Release files / g_batch_prediction_pipeline-0.3.0-py3-none-any.whl

Download URL g_batch_prediction_pipeline-0.3.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
445247c6e65b16347a22bdb39f1b4e59a30a5dcede5f01b82258b6a7b3f89215
BLAKE2b-256 checksum
How to use checksums
34a0f3d82c7e76ba6bdc22faedf4504f1d2e6a2cfe6750c28dcc408e6b4f63ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.9 Darwin/22.3.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page