Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Rajdeep-naha
Copy link
Contributor

@Rajdeep-naha Rajdeep-naha commented Jun 1, 2025

What does this implement/fix? Explain your changes.

Fixes #8325. This PR resolves an issue where the SubLOF detector fails when provided with numpy array inputs. The problem was caused by inconsistent input handling in the base class and redundant conversions in SubLOF.

Key changes:

  1. BaseDetector Fix:

    • Updated BaseDetector.fit() to consistently use the converted input (X_inner) when calling _fit()
    • Ensures proper handling of all input types (numpy arrays, pandas Series/DataFrame)
  2. SubLOF Improvements:

    • Removed redundant Series to DataFrame conversion in SubLOF._fit() since the base class now handles this
    • Updated docstrings to clearly document support for numpy arrays and pandas objects

Does your contribution introduce a new dependency? If yes, which one?

No new dependencies were added.

What should a reviewer concentrate their feedback on?

  • The change in BaseDetector.fit() to always pass X_inner to _fit()
  • Removal of redundant conversion in SubLOF._fit()

Did you add any tests for the change?

No new tests were added, but existing tests were verified to pass.

Any other comments?

The fix ensures that SubLOF works consistently with different input types as expected.

PR checklist

  • I've added myself to the list of contributors
  • The PR title starts with [BUG]

- Fix inconsistent input handling in BaseDetector.fit()
- Remove redundant Series conversion in SubLOF._fit
- Update docstring to document supported input types
@Rajdeep-naha
Copy link
Contributor Author

@benHeid I wanted to check in on my PR submitted a while ago. Are there any changes required to move it forward?
Thanks!

@fkiraly fkiraly changed the title [BUG] Fixes #8325 - SubLOF cannot handle numpy arrays as input [BUG] Fix missing input conversion in BaseDetector Aug 21, 2025
@fkiraly fkiraly added module:detection detectors module: outliers, change points, segmentation bugfix Fixes a known bug or removes unintended behavior labels Aug 21, 2025
@fkiraly fkiraly merged commit b22e76d into sktime:main Aug 22, 2025
65 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a known bug or removes unintended behavior module:detection detectors module: outliers, change points, segmentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] SUBLof cannot handle numpy arrays as input
2 participants