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

Issues with plotting the DecisionBoundaryDisplay #573

Open
ETTAN93 opened this issue May 14, 2024 · 0 comments
Open

Issues with plotting the DecisionBoundaryDisplay #573

ETTAN93 opened this issue May 14, 2024 · 0 comments

Comments

@ETTAN93
Copy link

ETTAN93 commented May 14, 2024

When using the sklearn's Isolation forest model, I can use the DecisionBoundaryDisplay function to plot for all 3 different response methods, e.g. 'predict' and 'decision_function', without any issues. Example is given here.

This is how I initialize the models.

from sklearn.ensemble import IsolationForest
iforest_model = IsolationForest(
    n_estimators=100,
    contamination=0.005,
    random_state=24,
)

iforest_model.fit(x_train)

disp = DecisionBoundaryDisplay.from_estimator(
        estimator=iforest_model,
        X=x_df_to_plot,
        response_method='decision_function',
        alpha=0.5,
    )

However, if I use the IForest from PYOD and try to do the same, I get the error below

from pyod.models.iforest import IForest
iforest_model = IForest(
    n_estimators=100,
    contamination=0.005,
    random_state=24,
)

image

Is a different object returned entirely from IForest compared to sklearn's version? How would I plot the same plot in PYOD?

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