We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
To reproduce:
#!/usr/bin/env python3 import numpy from deepod.models.time_series.dif import DeepIsolationForestTS arr = numpy.empty(shape=(33, 741)) arr.fill(1.0) # Also reproduces the issue: # arr = numpy.random.rand(33, 741) dif = DeepIsolationForestTS(device=None, seq_len=min(arr.shape[0], 100), max_samples=min(arr.shape[0], 256), hidden_dims=100) dif.fit(arr) scores = dif.decision_function(arr) print(scores)
Output:
$VIRTUAL_ENV/lib/python3.9/site-packages/deepod/models/tabular/dif.py:256: RuntimeWarning: invalid value encountered in divide scores = 2 ** (-depth_sum / (len(clf.estimators_) * _average_path_length([clf.max_samples_]))) [00:00<00:00, 1088.64it/s] [ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. nan]
The text was updated successfully, but these errors were encountered:
Some more clues as to the source of this issue: The first seq_len -1 samples are always zero (which should perhaps be the title of the issue):
seq_len -1
#!/usr/bin/env python3 import numpy from deepod.models.time_series.dif import DeepIsolationForestTS arr = numpy.random.rand(256, 256) dif = DeepIsolationForestTS(device='cpu', seq_len=10, max_samples=min(arr.shape[0], 256), hidden_dims=100) dif.fit(arr) scores = dif.decision_function(arr) print(scores) # Output: [ 0. 0. 0. 0. 0. 0. 0. 0. 0. 31026.44215442 30419.1558587 31492.80078777 31453.71368052 31583.28407603 31244.13219935 31221.5422394 ...
It would appear that these lines are responsible:
DeepOD/deepod/models/time_series/dif.py
Lines 157 to 158 in c2c7566
Sorry, something went wrong.
No branches or pull requests
To reproduce:
Output:
The text was updated successfully, but these errors were encountered: