Skip to content

[ENH] Add test coverage for anomaly_detection.collection estimators #3184

@Adityakushwaha2006

Description

@Adityakushwaha2006

Describe the issue

While exploring the anomaly detection module (I'm interested in contributing to this area), I noticed that the collection submodule doesn't have any tests, while the series submodule has comprehensive test coverage.

Looking through the code, I found that _classification.py and _outlier_detection.py were added in PR #2326 (commit c8c63d1) and both appear to be fully testable, they even include _get_test_params() methods, which suggests tests were intended but never added.

Current State
Missing:

  • aeon/anomaly_detection/collection/tests/ directory (doesn't exist)
  • Test coverage for ClassificationAdapter
  • Test coverage for OutlierDetectionAdapter

For comparison: aeon/anomaly_detection/series/tests/ has test_base.py and test_pyod_adapter.py with good coverage.

Suggest a potential alternative/fix
I'd like to add comprehensive tests for the collection module to bring it up to the same standard as the series module:

Proposed Changes:

Create test infrastructure:

  • Add aeon/anomaly_detection/collection/tests/ directory
  • Add init.py

Add test files:

  • test_classification.py - Tests for ClassificationAdapter
  • test_outlier_detection.py - Tests for OutlierDetectionAdapter

Test coverage will include:

  • Initialization with valid and invalid parameters
  • Fit and predict functionality
  • Integration with sklearn/aeon estimators
  • Error handling for edge cases
  • Reproducibility checks

Additional context
No response

Metadata

Metadata

Labels

anomaly detectionAnomaly detection packageenhancementNew feature, improvement request or other non-bug code enhancementtestingTesting related issue or pull request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions