A case-based reasoning python library that aims to help researchers find similar cases according to an input case with a wide range of methods that can detect similarity based on the features of each time series
Project description
CBR-FoX: Case-Based Reasoning for Time Series Prediction Explanations
CBR-FoX is a Python library designed to provide case-based reasoning explanations for time series prediction models. This approach enhances the transparency and interpretability of machine learning models applied to sequential data.
Features
- Case-Based Reasoning (CBR) Implementation: Utilizes case-based reasoning to enhance explainability in time series predictions.
- Versatile & Adaptable: Supports various types of time series data.
- ML Model Compatibility: Easily integrates with common machine learning models.
- Comprehensible Explanations: Provides clear, human-readable insights into model predictions.
Installation
To install CBR-FoX and its dependencies, either clone the repository or use the pip package manager:
Install via PyPI
pip install CBR-FoX
Install via GitHub
# Clone the repository
git clone https://github.com/aaaimx/CBR-FoX.git
cd CBR-FoX
# Install required dependencies
pip install -r requirements.txt
Usage
Follow these steps to use CBR-FoX in your projects:
1. Retrieve Model Information
Extract the relevant inputs and outputs from your AI model.
2. Create CBR-FoX Instances
from cbr_fox import CBRfoxInstances
cbr_instances = CBRfoxInstances(model_outputs)
3. Initialize the Builder
from cbr_fox import CBRfoxBuilder
builder = CBRfoxBuilder(cbr_instances)
4. Train the Instance
builder.fit(train_windows, train_targets, target_to_analyze, window_to_predict)
5. Obtain Explanations
builder.predict(prediction=prediction, num_cases=5)
6. Visualize Results
builder.visualize_pyplot(
fmt='--d',
scatter_params={'s': 50},
xtick_rotation=50,
title='Example Visualization',
xlabel='X-axis',
ylabel='Y-axis'
)
Library Usage Diagram
The following diagram illustrates the typical workflow of CBR-FoX, from retrieving AI model outputs to generating visual explanations.
Library File Relation Diagram
The following diagram represents the core classes and their interactions within the library. The cci_distance file is utilized when an instance is created using the custom distance metric implemented in this script.
For further details, check out the official documentation: CBR-FoX on Read the Docs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cbr_fox-1.0.2.tar.gz.
File metadata
- Download URL: cbr_fox-1.0.2.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f80e5377d57bc9e31e8a139bef20cfff5354e7c7fb3e653d151b768d7bdde624
|
|
| MD5 |
c0254491fe723c11ccc48a0ee21257d6
|
|
| BLAKE2b-256 |
34377e5a52f17abce4633efcb42fca338cc05325d020f29a05fe63f55f9756ef
|
Provenance
The following attestation bundles were made for cbr_fox-1.0.2.tar.gz:
Publisher:
publish.yml on aaaimx/CBR-FoX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbr_fox-1.0.2.tar.gz -
Subject digest:
f80e5377d57bc9e31e8a139bef20cfff5354e7c7fb3e653d151b768d7bdde624 - Sigstore transparency entry: 468552297
- Sigstore integration time:
-
Permalink:
aaaimx/CBR-FoX@f8959b032fb55555e4c76551709b16f8425e6042 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/aaaimx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8959b032fb55555e4c76551709b16f8425e6042 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cbr_fox-1.0.2-py3-none-any.whl.
File metadata
- Download URL: cbr_fox-1.0.2-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0388e8ccea0592dfb884bf489839ef3cec8f73768b0ebf71510c4a9bf4656e50
|
|
| MD5 |
e17289412a6603412b39b07a7697eaba
|
|
| BLAKE2b-256 |
974fee31a09a4458729bf79c367655c341d7763d5d98ab8f1d0e233e00692acc
|
Provenance
The following attestation bundles were made for cbr_fox-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on aaaimx/CBR-FoX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cbr_fox-1.0.2-py3-none-any.whl -
Subject digest:
0388e8ccea0592dfb884bf489839ef3cec8f73768b0ebf71510c4a9bf4656e50 - Sigstore transparency entry: 468552328
- Sigstore integration time:
-
Permalink:
aaaimx/CBR-FoX@f8959b032fb55555e4c76551709b16f8425e6042 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/aaaimx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8959b032fb55555e4c76551709b16f8425e6042 -
Trigger Event:
push
-
Statement type: