pyod icon indicating copy to clipboard operation
pyod copied to clipboard

check_array added to fit in iforest and ecod

Open luismavs opened this issue 2 years ago • 1 comments

Hey,

For iforest models fitted with pandas Dataframes and then scored with decision_function() on pandas DataFrames, the following warning pops up:

xxxx/site-packages/sklearn/base.py:402: UserWarning: X has feature names, but IsolationForest was fitted without feature names

I have added very simple scikit learn utils check_array() to X in decision_function() to iforest (and ecod) models to suppress the warning.

All Submissions Basics:

  • [x] Have you followed the guidelines in our Contributing document?
  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • [x] Have you checked all Issues to tie the PR to a specific one?

All Submissions Cores:

  • [x] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [ ] Have you written new tests for your core changes, as applicable?
  • [x] Have you successfully ran tests with your changes locally?
  • [x] Does your submission pass tests, including CircleCI, Travis CI, and AppVeyor?
  • [x] Does your submission have appropriate code coverage? The cutoff threshold is 95% by Coversall.

luismavs avatar Jan 21 '23 11:01 luismavs

hi, any update on this :) ? thanks for the package!

luismavs avatar Jun 27 '23 08:06 luismavs