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

DistanceMetric hotfix #513

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pyod/models/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@

from __future__ import division, print_function

import importlib

import numpy as np
from sklearn.neighbors import DistanceMetric
import sklearn
from sklearn.utils import check_array, check_random_state
from sklearn.utils.validation import check_is_fitted

from .base import BaseDetector

skmodule = 'sklearn.metrics' if sklearn.__version__ >= "1.3.0" else 'sklearn.neighbors'
DistanceMetric = getattr(importlib.import_module(skmodule), 'DistanceMetric')


class Sampling(BaseDetector):
"""Sampling class for outlier detection.
Expand Down