yzhao062 / pyod

A Python Library for Outlier and Anomaly Detection, Integrating Classical and Deep Learning Techniques
http://pyod.readthedocs.io
BSD 2-Clause "Simplified" License
8.54k stars 1.36k forks source link

compile error in examples/compare_all_models.py #195

Open NeighborhoodCoding opened 4 years ago

NeighborhoodCoding commented 4 years ago

I just download your code and run examples/compare_all_models.py

but it has compile error as belows.. I think it may be a error(cuase I didn't change any thing from the code)? And I wonder... I need to detect the percent of outliers. But the code has default contamination_percent. Could you remove it in your future version? I think using the outlier score or probability... may support the detecting the default(?) contamination_percent using the train_set? of the input data in your future version of pyod. thanks.


12 fitting Locally Selective Combination (LSCP) Traceback (most recent call last): File "C:/Users/owner/Downloads/pyod-master/pyod-master/examples/compare_all_models.py", line 140, in scores_pred = clf.decision_function(X) * -1 File "C:\Users\owner\AppData\Local\Programs\Python\Python36\lib\site-packages\pyod\models\lscp.py", line 212, in decision_function decision_scores = self._get_decision_scores(X) File "C:\Users\owner\AppData\Local\Programs\Python\Python36\lib\site-packages\pyod\models\lscp.py", line 273, in _get_decision_scores local_pseudo_ground_truth, local_train_scores[:, d])[0] File "C:\Users\owner\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\stats\stats.py", line 3501, in pearsonr raise ValueError('x and y must have length at least 2.') ValueError: x and y must have length at least 2.

Process finished with exit code 1

NeighborhoodCoding commented 4 years ago

I think

https://github.com/yzhao062/pyod/issues/194

maybe related to this. thx.