Metadata-Version: 2.4
Name: tarandm_analytics
Version: 1.2.1.dev1
Summary: Package links analytics in Python with TaranDM software.
License: Copyright © 2021-2026: Taran Advisory PTE. LTD.
         9 Raffles Place, #06-01, Republic Plaza, Singapore, 048619
         ACRA Registration No. 201902470R
         info@taran.ai
         ("Taran")
         Exercise of exclusive rights to this package belongs to Taran and distribution, duplication or any other usage without a duly signed, valid and effective license agreement from Taran is prohibited.
License-File: LICENSE
Author: Ondrej Sramek
Author-email: osramek@taran.ai
Requires-Python: >=3.13,<3.14
Classifier: License :: Other/Proprietary License
Requires-Dist: deepdiff
Requires-Dist: defusedxml
Requires-Dist: furl
Requires-Dist: gitpython
Requires-Dist: lifelines
Requires-Dist: llvmlite
Requires-Dist: matplotlib
Requires-Dist: numba (>=0.60.0)
Requires-Dist: numpy (<2)
Requires-Dist: pandas
Requires-Dist: path
Requires-Dist: pep8
Requires-Dist: polars
Requires-Dist: pydantic
Requires-Dist: python-gitlab
Requires-Dist: requests
Requires-Dist: ruamel-yaml
Requires-Dist: scikit-learn (<1.7)
Requires-Dist: shap
Requires-Dist: sklearn_pmml_model
Requires-Dist: structlog
Requires-Dist: tarandm-analytics-utils
Requires-Dist: xgboost
Description-Content-Type: text/markdown

# TaranDM analytics

TaranDM analytics is a package with supportive functions for TaranDM decision manager software. Two main areas are covered:
- Preparation of predictive model deployment
- Preparation of dataset for predictive model development - attribute evaluator

An **example notebook** how to use `tarandm_analytics` is included in the package in `tarandm_analytics/examples/tarandm_model_development.ipynb` 

## Predictive model deployment
Strategies in TaranDM can contain predictive models. For compatibility, TaranDM requires specific format in which the 
model is deployed. `tarandm_analytics` package provides functions to make the deployment easy.

In TaranDM, predictive models are stored alongside with additional metadata. Those can be used for instance to monitor 
the model stability. Information about development sample and model performance is also stored amongst others.

After training the predictive model, steps to prepare the model for deployment would typically be:
1. Initialize `ExportPredictiveModel` from `tarandm_analytics` package.
2. Prepare monitoring data using `get_monitoring_data` method. This will calculate data to monitor stability through 
population stability index (PSI).
3. Prepare predictive model data for export to disk using `prepare_predictive_model_data` method.
4. Export model to disk using `build_predictive_model` method. Model is exported in zip format, that can be uploaded to 
TaranDM strategy in GUI.

## Attribute evaluator

Attribute evaluator provides functions to create a dataset for predictive model development. Past requests are fetched 
from database and attributes defined in TaranDM attribute classes are evaluated. It uses the same code to evaluate 
attributes as the production environment, which eliminates potential mismatch in attribute definition during 
implementation to production.

User can either define past requests to be included in the dataset by listing decision ids directly or by defining 
business case and time range. Attribute classes to be evaluated are also defined by user.

To prepare the dataset:
1. Initialize `EvaluateAttributes` class.
2. List available attribute classes using `get_attribute_classes`.
3. List available business cases using `get_business_cases`.
4. Run `evaluate` method. Business case, time range or list of decision ids are provided as parameters of the method. 
Note that user is required to provide Git repository with strategies as well as credentials for the repository.
5. Once the attributes are evaluated, fetch the data using `fetch_data_from_db` method. It requires process ID as a 
parameter. This can be found in `last_attribute_extractor_id` property of `EvaluateAttributes` object.


