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

AttributeError: 'IsolationForest' object has no attribute 'n_features' #4

Open
khanwa opened this issue Feb 11, 2024 · 0 comments
Open

Comments

@khanwa
Copy link

khanwa commented Feb 11, 2024

Hello, Thank you for the nice work. The IF has issue with n_features.

     46 def _score_samples(iforest, tree_idx, X):
---> 47     if iforest.n_features_in != X.shape[1]:
     48         raise ValueError("Number of features of the model must "
     49                          "match the input. Model n_features is {0} and "
     50                          "input n_features is {1}."
     51                          "".format(iforest.n_features_in, X.shape[1]))
     52     return -_compute_chunked_score_samples(iforest, tree_idx, X)

AttributeError: 'IsolationForest' object has no attribute 'n_features_in'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant