# 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](https://tangram.adeo.com/products/1d6f6abb-63ba-4663-bd1e-18007bffde36/overview)
## Table of Contents
- [Project Structure](#project-structure)
- [Features](#features)
- [Installation/Usage](#Installation/Usage)
- [Contact](#Contact)
## 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
```python
pip install ai-management
```
## Usage
### Binary classification
```python
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
```python
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
```python
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
```python
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
```python
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
```python
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
* Leroy Merlin Brazil AI scientists and developers: chapter_inteligencia_artificia@leroymerlin.com.br
Raw data
{
"_id": null,
"home_page": "https://github.com/adeo/aim",
"name": "ai-management",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "management,toolbox,lmbr,ai",
"author": "Leroy Merlin Brazil",
"author_email": "chapter_inteligencia_artificia@leroymerlin.com.br",
"download_url": "https://files.pythonhosted.org/packages/bd/03/3a86ba2e45e4567d256559f4e7d6754f99e0955d632dbc8b0c041ad69f28/ai_management-1.0.40.tar.gz",
"platform": null,
"description": "# Artificial Intelligence Management\n\n> This is a toolbox to help AI & ML teams to have a better management of their metrics and processes.\n\nOur 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\n\n[Confluence Documentation Link]()\n\n[Tangram Link](https://tangram.adeo.com/products/1d6f6abb-63ba-4663-bd1e-18007bffde36/overview)\n\n## Table of Contents\n\n- [Project Structure](#project-structure)\n- [Features](#features)\n- [Installation/Usage](#Installation/Usage)\n- [Contact](#Contact)\n\n## Project Structure\n\nDescribe the structure of the `project` folder, including the organization of modules, directories, and any important files.\n\n```\nai_management/\n\u251c\u2500\u2500 __init__.py\n\u251c\u2500\u2500 model_evaluation.py\n\u251c\u2500\u2500 config.yaml\n```\n\nExplain the purpose of each module or significant files.\n\n## ModelEvaluation\n\nHistorize the technical model evaluation results at a Google Big Query table at a Google Cloud Platform project.\n\n## Installation\n```python\npip install ai-management\n```\n\n## Usage\n\n### Binary classification\n```python\ny_true = [1, 0, 0, 1, 1]\ny_pred = [1, 0, 0, 0, 1]\n\ny_test_a_lst = y_true\ny_pred_a_lst = y_pred\n\ny_test_a_arr = np.array(y_true)\ny_pred_a_arr = np.array(y_pred)\n```\n\n### Multi class classification\n```python\ny_true = [0, 1, 2, 1, 2]\ny_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]]\n\ny_test_b_lst = y_true\ny_pred_b_lst = y_pred\n\ny_test_b_arr = np.array(y_true)\ny_pred_b_arr = np.array(y_pred)\n```\n\n### Multi label classification\n```python\ny_test = [[0, 1, 2], [3, 4, 5], [6, 7, 8]]\ny_pred = [[0, 1, 2], [3, 4, 5], [6, 7, 9]]\n\ny_test_c_lst = y_test\ny_pred_c_lst = y_pred\n\ny_test_c_arr = np.array(y_true)\ny_pred_c_arr = np.array(y_pred)\n```\n### Regression\n```python\ny_true = [2.5, 3.0, 4.0, 5.5, 6.0]\ny_pred = [2.0, 3.5, 3.8, 5.0, 6.5]\n\ny_test_d_lst = y_true\ny_pred_d_lst = y_pred\n\ny_test_d_arr = np.array(y_true)\ny_pred_d_arr = np.array(y_pred)\n```\n\n### Assossiation Rules\n```python\nimport pandas as pd\nimport numpy as np\n\n# Create a dataframe with random values\ndf_assossiation = pd.DataFrame({\n 'ID_PRNCPAL': np.random.randint(1, 50000, size=103846),\n 'CONFIDENCE': np.random.uniform(0.01, 0.03, size=103846)\n})\n\ndf_assossiation.sort_values('ID_PRNCPAL')\n```\n\n\n\n### Solution Evaluation\n```python\nimport ai_management as aim \nclient_bq = bigquery.Client(project='project')\nme = aim.ModelEvaluation(\n client_bq=client_bq,\n destination='project.dataset.table'\n)\n\n# Historizing standard metrics\nme.historize_model_evaluation(\n soltn_nm = 'Solution X', \n lst_mdls = [\n {\n 'mdl_nm' : 'Model A',\n 'algrthm_typ' : 'binary_classification',\n 'data' : [y_test_a_lst, y_pred_a_lst]}, \n {\n 'mdl_nm' : 'Model B',\n 'algrthm_typ' : 'multi_class_classification',\n 'data' : [y_test_b_lst, y_pred_b_lst]},\n {\n 'mdl_nm' : 'Model C',\n 'algrthm_typ' : 'multi_label_classification',\n 'data' : [y_test_c_lst, y_pred_c_lst]},\n {\n 'mdl_nm' : 'Model D',\n 'algrthm_typ' : 'assossiation',\n 'data' : ['confidence', df_assossiation]},\n ]\n)\n\n# Historizing custom metrics\nme.historize_custom_metric(\n soltn_nm = \"Solution Y\",\n lst_mdls = [\n {\n 'mdl_nm': 'Model E',\n 'algrthm_typ': 'regression',\n 'data': [\n [\"Lin's Concordance Correlation Coefficient\", 0.85, None],\n [\"Huber's error\", 123, {\"delta\": 0.75}],\n ]\n },\n ]\n)\n```\n\n## Contact\n\n* Leroy Merlin Brazil AI scientists and developers: chapter_inteligencia_artificia@leroymerlin.com.br\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "This is a toolbox to help AI & ML teams to have a better management of their metrics.",
"version": "1.0.40",
"project_urls": {
"Bug Tracker": "https://github.com/adeo/aim/issues",
"Homepage": "https://github.com/adeo/aim"
},
"split_keywords": [
"management",
"toolbox",
"lmbr",
"ai"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6d64b478c28fb2184513877d6703019d0882a4f73b876de5ac6492a1cde52a6c",
"md5": "ad9347c756ce905a1a5585064575f040",
"sha256": "014c2fc611ec9ab402327d25e9716785172f9c580bcadf3bd149d0013de2d0a0"
},
"downloads": -1,
"filename": "ai_management-1.0.40-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ad9347c756ce905a1a5585064575f040",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 22901,
"upload_time": "2024-01-17T17:29:34",
"upload_time_iso_8601": "2024-01-17T17:29:34.877765Z",
"url": "https://files.pythonhosted.org/packages/6d/64/b478c28fb2184513877d6703019d0882a4f73b876de5ac6492a1cde52a6c/ai_management-1.0.40-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bd033a86ba2e45e4567d256559f4e7d6754f99e0955d632dbc8b0c041ad69f28",
"md5": "aeb9412e8e4215c63219022184df71b2",
"sha256": "883173bbce3760ce490472ad4ea37051fc917180d06ddf9c4a9971eb003f07df"
},
"downloads": -1,
"filename": "ai_management-1.0.40.tar.gz",
"has_sig": false,
"md5_digest": "aeb9412e8e4215c63219022184df71b2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10933,
"upload_time": "2024-01-17T17:29:47",
"upload_time_iso_8601": "2024-01-17T17:29:47.779765Z",
"url": "https://files.pythonhosted.org/packages/bd/03/3a86ba2e45e4567d256559f4e7d6754f99e0955d632dbc8b0c041ad69f28/ai_management-1.0.40.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-17 17:29:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adeo",
"github_project": "aim",
"github_not_found": true,
"lcname": "ai-management"
}