Skip to content

Commit

Permalink
Merge pull request #487 from yzhao062/development
Browse files Browse the repository at this point in the history
urgent fix for nan in ECOD and COPOD
  • Loading branch information
yzhao062 authored Mar 20, 2023
2 parents 4ea2b87 + cbc8c94 commit c4aecd1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@ v<1.0.7>, <12/14/2022> -- Enable automatic thresholding by pythresh (#454).
v<1.0.8>, <03/08/2023> -- Improve clone compatibility (#471).
v<1.0.8>, <03/08/2023> -- Add QMCD detector (#452).
v<1.0.8>, <03/08/2023> -- Optimized ECDF and drop Statsmodels dependency (#467).
v<1.0.9>, <03/19/2023> -- Hot fix for errors in ECOD and COPOD due to the issue of scipy.
6 changes: 5 additions & 1 deletion pyod/models/copod.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
import matplotlib.pyplot as plt
import numpy as np
from joblib import Parallel, delayed
from scipy.stats import skew
from scipy.stats import skew as skew_sp
from sklearn.utils import check_array

from .base import BaseDetector
from .sklearn_base import _partition_estimators
from ..utils.stat_models import column_ecdf


def skew(X, axis=0):
return np.nan_to_num(skew_sp(X, axis=axis))


def _parallel_ecdf(n_dims, X):
"""Private method to calculate ecdf in parallel.
Parameters
Expand Down
6 changes: 5 additions & 1 deletion pyod/models/ecod.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
import matplotlib.pyplot as plt
import numpy as np
from joblib import Parallel, delayed
from scipy.stats import skew
from scipy.stats import skew as skew_sp
from sklearn.utils import check_array

from .base import BaseDetector
from .sklearn_base import _partition_estimators
from ..utils.stat_models import column_ecdf


def skew(X, axis=0):
return np.nan_to_num(skew_sp(X, axis=axis))


def _parallel_ecdf(n_dims, X):
"""Private method to calculate ecdf in parallel.
Parameters
Expand Down
2 changes: 1 addition & 1 deletion pyod/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#
__version__ = '1.0.8' # pragma: no cover
__version__ = '1.0.9' # pragma: no cover

0 comments on commit c4aecd1

Please sign in to comment.