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

DIF model: duplicate normalization #546

Open
ValeZ1 opened this issue Feb 29, 2024 · 0 comments
Open

DIF model: duplicate normalization #546

ValeZ1 opened this issue Feb 29, 2024 · 0 comments

Comments

@ValeZ1
Copy link

ValeZ1 commented Feb 29, 2024

On the DIF (Deep Isolation Forest) model, in the fit function, the variable X is normalized. Then it is passed to decision_function to compute the decision_scores_, where it is normalized again. This results in a mismatch between decision_scores_ and scores obtained by calling decision_function(X) on the same X.

Normalization:

pyod/pyod/models/dif.py

Lines 173 to 175 in 690a0f2

self.minmax_scaler = MinMaxScaler()
self.minmax_scaler.fit(X)
X = self.minmax_scaler.transform(X)

decision_function call:

pyod/pyod/models/dif.py

Lines 215 to 216 in 690a0f2

self.decision_scores_ = self.decision_function(X)
self._process_decision_scores()

Normalization in decision_function:

X = self.minmax_scaler.transform(X)

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