Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically check input of anomaly detectors #90

Open
LouisCarpentier42 opened this issue Feb 17, 2025 · 0 comments
Open

Automatically check input of anomaly detectors #90

LouisCarpentier42 opened this issue Feb 17, 2025 · 0 comments
Labels
anomaly detector Implement a new anomaly detector

Comments

@LouisCarpentier42
Copy link
Collaborator

Currently, the BaseDetector does nothing with regards to .fit(X, y) and .decision_function(X). When implementing a new detector, the user has to do all the checks manually (is valid array, transform to np array, check if fitted). The beginning of each implemented .fit(X, y) and .decision_function(X) is therefore almost identical.

This issue can be resolved by taking an approach similar to the Preprocessor or Metric classes, with additional methods ._fit(X, y) and _decision_function(X), which effectively implement the anomaly detector. The original .fit(X, y) and .decision_function(X) then simply perform the necessary checks and formatting, and then call these new functions.

In addition, a method is_fitted() could be added to the BaseDetector, which returns whether the detector has been initilialized. This can be done by a simple boolean property or by checking if all properties with a trailing underscore have been instantiated.

@LouisCarpentier42 LouisCarpentier42 added the anomaly detector Implement a new anomaly detector label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anomaly detector Implement a new anomaly detector
Projects
None yet
Development

No branches or pull requests

1 participant