Skip to main content

Confidence-Consistency Evaluation for Time Series Anomaly Detection

Project description

CCE: Confidence-Consistency Evaluation for Time Series Anomaly Detection

Python License PyPI

A comprehensive evaluation framework for time series anomaly detection metrics, focusing on confidence-consistency evaluation, robustness assessment, and discriminative power analysis.

๐Ÿš€ Features

  • Multi-metric Evaluation: Support for various anomaly detection metrics (F1, AUC-ROC, VUS-PR, etc.)
  • Performance Benchmarking: Latency analysis and theoretical ranking validation
  • Robustness Assessment: Noise-resistant evaluation with variance consideration
  • Discriminative Power Analysis: Both ranking-based and value-change-ratio-based approaches
  • Automated Testing: Streamlined evaluation pipeline for new metrics
  • Real-world Dataset Support: Comprehensive testing on multiple datasets

๐Ÿ“ฆ Installation

Option 1: Install from PyPI (Recommended)

pip install cce

Option 2: Install from Source

# Clone the repository
git clone https://github.com/EmorZz1G/CCE.git
cd CCE

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

Note: Build-related files are located in the docs directory. For detailed build instructions, please refer to docs/*.md.

๐Ÿ”ง Requirements

  • Python 3.8+
  • PyTorch
  • NumPy
  • Other dependencies (see requirements.txt)

โš™๏ธ Configuration

After installation, you may need to configure the datasets path:

# Create a configuration file
cce config create

# Set your datasets directory
cce config set-datasets-path /path/to/your/datasets

# View current configuration
cce config show

For detailed configuration options, see Configuration Guide.

๐Ÿ“š Quick Start

Basic Usage

# Run baseline evaluation
. scripts/run_baseline.sh

# Run real-world dataset evaluation
. scripts/run_real_world.sh

Adding New Metrics

  1. Implement the metric function in src/metrics/basic_metrics.py:

    def metric_NewMetric(labels, scores, **kwargs):
        # Your metric implementation
        return metric_value
    
  2. Add evaluation logic in src/evaluation/eval_metrics/eval_latency_baselines.py:

    elif baseline == 'NewMetric':
        with timer(case_name, model_name, case_seed_new, score_seed_new, model, metric_name='NewMetric') as data_item:
            result = metricor.metric_NewMetric(labels, scores)
            data_item['val'] = result
    
  3. Run the evaluation:

    python src/evaluation/eval_metrics/eval_latency_baselines.py --baseline NewMetric
    
  4. View results in logs/NewMetric/

๐Ÿ—๏ธ Project Structure

CCE/
โ”œโ”€โ”€ src/                    # Source code
โ”‚   โ”œโ”€โ”€ metrics/           # Metric implementations
โ”‚   โ”œโ”€โ”€ evaluation/        # Evaluation framework
โ”‚   โ”œโ”€โ”€ models/            # Model implementations
โ”‚   โ”œโ”€โ”€ data_utils/        # Data processing utilities
โ”‚   โ”œโ”€โ”€ utils/             # Helper functions
โ”‚   โ””โ”€โ”€ scripts/           # Execution scripts
โ”œโ”€โ”€                   # Build and installation files
โ”‚   โ”œโ”€โ”€ setup.py           # Package setup configuration
โ”‚   โ”œโ”€โ”€ pyproject.toml     # Modern Python package config
โ”‚   โ”œโ”€โ”€ MANIFEST.in        # Package file inclusion
โ”‚   โ”œโ”€โ”€ BUILD.md           # Detailed build instructions
โ”‚   โ””โ”€โ”€ INSTALL.md         # Quick install guide
โ”œโ”€โ”€ datasets/              # Dataset storage
โ”œโ”€โ”€ logs/                  # Evaluation results
โ”œโ”€โ”€ tests/                 # Test files
โ”œโ”€โ”€ docs/                  # Documentation
โ”œโ”€โ”€ requirements.txt       # Dependencies
โ”œโ”€โ”€ setup.py               # Simple setup entry point
โ””โ”€โ”€ pyproject.toml         # Basic build configuration

๐Ÿ“Š Supported Evaluations

  • Latency Analysis: Metric computation time measurement
  • Theoretical Ranking: Validation against theoretical expectations
  • Robustness Assessment: Noise resistance evaluation
  • Discriminative Power: Ranking-based and value-change-ratio analysis

๐Ÿ”„ Updates

  • 2025-08-26: Core evaluation framework implementation
  • 2025-08-26: Multi-metric support and benchmarking

๐Ÿ“‹ TODO List

  • Automated standard evaluation pipeline
  • Enhanced robustness assessment
  • Advanced discriminative power analysis
  • CI/CD integration for metric testing

๐Ÿค Contributing

We welcome contributions! Please feel free to submit issues and pull requests.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • FTSAD: For providing the time series anomaly detection evaluation framework
  • SimAD: For dataset load.
  • TSB-AD: For model implementation code
  • Community: For feedback and contributions

๐Ÿ“ž Contact

For questions and support, please open an issue on GitHub or contact the maintainers.


CCE - Making time series anomaly detection evaluation more reliable and comprehensive.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cce-0.2.0.tar.gz (230.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cce-0.2.0-py3-none-any.whl (145.6 kB view details)

Uploaded Python 3

File details

Details for the file cce-0.2.0.tar.gz.

File metadata

  • Download URL: cce-0.2.0.tar.gz
  • Upload date:
  • Size: 230.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for cce-0.2.0.tar.gz
Algorithm Hash digest
SHA256 12beb6659117d243a1ee5c5b4ac30d005be1af345942c491086e73fdd5ae0f3e
MD5 4a7e8ad91fa064c53a9ff3d1a0c3596d
BLAKE2b-256 b89e597fd0aecb827d56003dcf179a7c5ace4cc800648325bef303988ca688ba

See more details on using hashes here.

File details

Details for the file cce-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cce-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 145.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for cce-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4c751afb6a592226ea435c1afd7d637cb6bd697db4ab8add41540864df8e188
MD5 18e14da70b5c1e665b0d22235369056b
BLAKE2b-256 8dc82a67c204bacece164e97f9009ad7f6931bd7f5398292f32876c95c32c61a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page