semvec/pypi-packages huggingface dataset:
tice-ml 1.0.5
Model agnostic Time-Series Counterfactual Engine.
License: MIT
Requires Python: >=3.9
Keywords: machine-learning explanation interpretability counterfactual

TiCE
====

**TiCE** is an extension of the `DiCE <https://github.com/interpretml/DiCE>`_ (Diverse Counterfactual Explanations) library, designed to provide counterfactual explanations with additional functionality and improvements. 
This library was developed as part of my master's thesis at TU Eindhoven while working at ASML.  

This package is especially tailored for regression and time series applications, while maintaining compatibility with DiCE's original design principles.

Acknowledgement
---------------

This work builds upon the excellent `DiCE <https://github.com/interpretml/DiCE>`_ library created by the team at **InterpretML**.  
I acknowledge and thank them for their contributions to the field of explainable AI.  

The improvements in **TiCE** extend DiCE's capabilities while staying true to its core mission: generating actionable and diverse counterfactual explanations.

Improvements in TiCE
--------------------

Compared to the original DiCE implementation, **TiCE** introduces the following enhancements:

- **Support for regression tasks**: Generate counterfactuals not only for classification but also for regression settings with a continious target variable.
- **Time series compatibility**: Adapted internal structures to handle sequential data, enabling counterfactual explanations for time-dependent models.
- **Improved data interface**: More flexible handling of continuous, categorical, and temporal features in heterogeneous datasets.
- **Advanced Visualization**: Dedicated visualization utilities tailored to time-series explanations are added. These visualization tools
transform hundreds of numeric scores into digestible figures, making it far easier for domain experts and
stakeholders to interpret model explanations and counterfactual suggestion


Installation
------------

You can install **TiCE** directly from PyPI::

   pip install tice

Usage
-----

The usage of **TiCE** follows the same structure as DiCE with minor adjustments::

   import TiCE

   tice_exp = (model, data_interface)
   counterfactuals = tice_exp.generate_counterfactuals(query_instance,
                                                       total_CFs=5,
                                                       desired_range=[value_min, value_max])