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

Skip to content

Conversation

Imvedansh
Copy link
Contributor

@Imvedansh Imvedansh commented Jun 1, 2025

Reference Issues/PRs
Fixes #8325

What does this implement/fix? Explain your changes.

Fixes SubLOF detector crash when using numpy arrays as input. The detector was trying to access .index attribute on numpy arrays which don't have this attribute.
Changes:

Added conditional check for .index attribute in base detection class and SubLOF detector
Created pandas RangeIndex fallback for numpy arrays
Fixed test import path and added numpy array test case

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

What should a reviewer concentrate their feedback on?

Numpy array handling logic correctness
Backward compatibility with pandas DataFrames/Series
Test coverage for both input types

Any other comments?
Maintains 100% backward compatibility. Before fix: model.fit_transform(np_array) crashed with AttributeError. After fix: works seamlessly.
PR checklist
For all contributions

[Y]The PR title starts with either [ENH], [MNT], [DOC], or [BUG]

…nd base detection class. Maintains pandas compatibility
@Imvedansh
Copy link
Contributor Author

@benHeid What do you think about this?

@fkiraly fkiraly changed the title [Bug] Fixes to SUBLof cannot handle numpy arrays as input #8325 [BUG] fix np.ndarray incompatibility in BaseDetector.fit_transform Aug 22, 2025
@fkiraly fkiraly added module:detection detectors module: outliers, change points, segmentation bugfix Fixes a known bug or removes unintended behavior labels Aug 22, 2025
@fkiraly fkiraly merged commit e6a7b56 into sktime:main Aug 22, 2025
1 check was pending
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