Skip to main content

Machine learning model contracts with machine learning infrastructure

Project description

Twinn-ml-interface

PyPI Latest Release Downloads License Code style: black

Twinn-ml-interface is a Python package for data contracts between machine learning code and infrastructure.

Author: Royal HaskoningDHV

Installation

The easiest way to install is package is using pip:

pip install twinn-ml-interface

Model Interface

Properties

model_type_name

An unique name for each model class.

model_category

Whether the model outputs anomalies, predictions or actuals. This determines the format in which the results are expected.

performance_value

The model is expected to calculate some metric value after training to indicate the model performance.

train_data_config

N/A for most cases.

target_tag

For most cases, return a UnitTagLiteral containing the unit code and tagname of the target of the model.

data_config

For most cases, return a list of UnitTagLiterals containing all the data that is used for training the model. The training window can be passed at runtime.

result_tag

For most cases, return a UnitTagLiteral of the result unit and tag of the model.

unit_properties_template

N/A for most cases.

unit_hierarchy_template

N/A for most cases.

train_window_finder_config_template

N/A for most cases.

Training

For training, the functions of the model interface are called in the following order:

  1. initialize
  2. preprocess
  3. validate_input_data
  4. train
  5. dump

Prediction

For prediction, the functions of the model interface are called in the following order:

  1. load
  2. predict

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twinn-ml-interface-0.2.10.dev0.tar.gz (14.2 kB view hashes)

Uploaded Source

Built Distribution

twinn_ml_interface-0.2.10.dev0-py3-none-any.whl (16.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page