Skip to main content

Artificial Intelligence Management

This is a toolbox to help AI & ML teams to have a better management of their metrics and processes.

Our desire is to enable the company with data related to AI solution, in a easy way to read and use. Some new goals are going to be included later

Confluence Documentation Link

Tangram Link

Table of Contents

Project Structure

Describe the structure of the project folder, including the organization of modules, directories, and any important files.

ai_management/
├── __init__.py
├── model_evaluation.py
├── config.yaml

Explain the purpose of each module or significant files.

ModelEvaluation

Historize the technical model evaluation results at a Google Big Query table at a Google Cloud Platform project.

Installation

pip install ai-management

Usage

Binary classification

y_true = [1, 0, 0, 1, 1]
y_pred = [1, 0, 0, 0, 1]

y_test_a_lst = y_true
y_pred_a_lst = y_pred

y_test_a_arr = np.array(y_true)
y_pred_a_arr = np.array(y_pred)

Multi class classification

y_true = [0, 1, 2, 1, 2]
y_pred = [[0.9, 0.1, 0.0], [0.3, 0.2, 0.5], [0.2, 0.3, 0.5], [0.1, 0.8, 0.1], [0.1, 0.2, 0.7]]

y_test_b_lst = y_true
y_pred_b_lst = y_pred

y_test_b_arr = np.array(y_true)
y_pred_b_arr = np.array(y_pred)

Multi label classification

y_test = [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
y_pred = [[0, 1, 2], [3, 4, 5], [6, 7, 9]]

y_test_c_lst = y_test
y_pred_c_lst = y_pred

y_test_c_arr = np.array(y_true)
y_pred_c_arr = np.array(y_pred)

Regression

y_true = [2.5, 3.0, 4.0, 5.5, 6.0]
y_pred = [2.0, 3.5, 3.8, 5.0, 6.5]

y_test_d_lst = y_true
y_pred_d_lst = y_pred

y_test_d_arr = np.array(y_true)
y_pred_d_arr = np.array(y_pred)

Assossiation Rules

import pandas as pd
import numpy as np

# Create a dataframe with random values
df_assossiation = pd.DataFrame({
    'ID_PRNCPAL': np.random.randint(1, 50000, size=103846),
    'CONFIDENCE': np.random.uniform(0.01, 0.03, size=103846)
})

df_assossiation.sort_values('ID_PRNCPAL')

Solution Evaluation

import ai_management as aim 
client_bq = bigquery.Client(project='project')
me = aim.ModelEvaluation(
    client_bq=client_bq,
    destination='project.dataset.table'
)

# Historizing standard metrics
me.historize_model_evaluation(
    soltn_nm = 'Solution X', 
    lst_mdls = [
        {
            'mdl_nm' : 'Model A',
            'algrthm_typ' : 'binary_classification',
            'data' : [y_test_a_lst, y_pred_a_lst]}, 
        {
            'mdl_nm' : 'Model B',
            'algrthm_typ' : 'multi_class_classification',
            'data' : [y_test_b_lst, y_pred_b_lst]},
        {
            'mdl_nm' : 'Model C',
            'algrthm_typ' : 'multi_label_classification',
            'data' : [y_test_c_lst, y_pred_c_lst]},
        {
            'mdl_nm' : 'Model D',
            'algrthm_typ' : 'assossiation',
            'data' : ['confidence', df_assossiation]},
    ]
)

# Historizing custom metrics
me.historize_custom_metric(
    soltn_nm = "Solution Y",
    lst_mdls = [
        {
            'mdl_nm': 'Model E',
            'algrthm_typ': 'regression',
            'data': [
                ["Lin's Concordance Correlation Coefficient", 0.85, None],
                ["Huber's error", 123, {"delta": 0.75}],
            ]
        },
    ]
)

Contact

Metadata

Release files for ai-management 1.0.40

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

Source distribution (sdist)

Source distribution for ai-management 1.0.40
File Size Uploaded Provenance
ai_management-1.0.40.tar.gz 10.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-management 1.0.40
File Interpreter ABI Platform
ai_management-1.0.40-py3-none-any.whl Python 3 none any Details

Total release size: 33.8 kB

Release files / ai_management-1.0.40.tar.gz

Download URL ai_management-1.0.40.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
883173bbce3760ce490472ad4ea37051fc917180d06ddf9c4a9971eb003f07df
BLAKE2b-256 checksum
How to use checksums
bd033a86ba2e45e4567d256559f4e7d6754f99e0955d632dbc8b0c041ad69f28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / ai_management-1.0.40-py3-none-any.whl

Download URL ai_management-1.0.40-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
014c2fc611ec9ab402327d25e9716785172f9c580bcadf3bd149d0013de2d0a0
BLAKE2b-256 checksum
How to use checksums
6d64b478c28fb2184513877d6703019d0882a4f73b876de5ac6492a1cde52a6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Security for ai-management 1.0.40

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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