class_docstr: Detects outliers in a dataset using the LoOP algorithm.
  
  The LoOP algorithm is a robust method for detecting outliers in a dataset across multiple variables by comparing
  the density in the area of a sample with the densities in the areas of its nearest neighbors.
  The output of the algorithm is highly dependent on the number of nearest neighbors, it is recommended to
  select a value k that represent the maximum cluster size that will still be considered as "outliers".
  See https://www.dbs.ifi.lmu.de/Publikationen/Papers/LoOP1649.pdf for more details.
  LoOP relies on a distance matrix, in our implementation we use the Gower distance that measure the distance
  between two samples based on its numeric and categorical features.
  See https://statisticaloddsandends.wordpress.com/2021/02/23/what-is-gowers-distance/ for further details.
  
  Parameters
  ----------
  columns : Union[Hashable, List[Hashable]] , default: None
      Columns to check, if none are given checks all columns except ignored ones.
  ignore_columns : Union[Hashable, List[Hashable]] , default: None
      Columns to ignore, if none given checks based on columns variable
  nearest_neighbors_percent : float, default: 0.01
      Percent of the dataset to use as K, nearest neighbors for the LoOP outlier detection. It is recommended to
      select a percentage that represent the maximum cluster size that will still be considered as "outliers".
  extent_parameter: int, default: 3
      Extend parameter for LoOP algorithm.
  n_samples : int , default: 5_000
      number of samples to use for this check.
  n_to_show : int , default: 5
      number of data elements with the highest outlier score to show (out of sample).
  random_state : int, default: 42
      random seed for all check internals.
  timeout : int, default: 10
      Check will be interrupted if it takes more than this number of seconds. If 0, check will not be interrupted.
class_docstr_tok: ["Detects","outliers","in","a","dataset","using","the","LoOP","algorithm",".","The","LoOP","algorithm","is","a","robust","method","for","detecting","outliers","in","a","dataset","across","multiple","variables","by","comparing","the","density","in","the","area","of","a","sample","with","the","densities","in","the","areas","of","its","nearest","neighbors",".","The","output","of","the","algorithm","is","highly","dependent","on","the","number","of","nearest","neighbors",",","it","is","recommended","to","select","a","value","k","that","represent","the","maximum","cluster","size","that","will","still","be","considered","as","``","outliers","''",".","See","https",":","\/\/www.dbs.ifi.lmu.de\/Publikationen\/Papers\/LoOP1649.pdf","for","more","details",".","LoOP","relies","on","a","distance","matrix",",","in","our","implementation","we","use","the","Gower","distance","that","measure","the","distance","between","two","samples","based","on","its","numeric","and","categorical","features",".","See","https",":","\/\/statisticaloddsandends.wordpress.com\/2021\/02\/23\/what-is-gowers-distance\/","for","further","details",".","Parameters","--","--","--","--","--","columns",":","Union","[","Hashable",",","List","[","Hashable","]","]",",","default",":","None","Columns","to","check",",","if","none","are","given","checks","all","columns","except","ignored","ones",".","ignore_columns",":","Union","[","Hashable",",","List","[","Hashable","]","]",",","default",":","None","Columns","to","ignore",",","if","none","given","checks","based","on","columns","variable","nearest_neighbors_percent",":","float",",","default",":","0.01","Percent","of","the","dataset","to","use","as","K",",","nearest","neighbors","for","the","LoOP","outlier","detection",".","It","is","recommended","to","select","a","percentage","that","represent","the","maximum","cluster","size","that","will","still","be","considered","as","``","outliers","''",".","extent_parameter",":","int",",","default",":","3","Extend","parameter","for","LoOP","algorithm",".","n_samples",":","int",",","default",":","5_000","number","of","samples","to","use","for","this","check",".","n_to_show",":","int",",","default",":","5","number","of","data","elements","with","the","highest","outlier","score","to","show","(","out","of","sample",")",".","random_state",":","int",",","default",":","42","random","seed","for","all","check","internals",".","timeout",":","int",",","default",":","10","Check","will","be","interrupted","if","it","takes","more","than","this","number","of","seconds",".","If","0",",","check","will","not","be","interrupted","."]
code: def __init__(
      self,
      columns: Union[Hashable, List[Hashable], None] = None,
      ignore_columns: Union[Hashable, List[Hashable], None] = None,
      nearest_neighbors_percent: float = 0.01,
      extent_parameter: int = 3,
      n_samples: int = 5_000,
      n_to_show: int = 5,
      random_state: int = 42,
      timeout: int = 10,
      **kwargs,
  ):
      super().__init__(**kwargs)
      if not isinstance(extent_parameter, int) or extent_parameter <= 0:
          raise DeepchecksValueError(
              "extend_parameter must be a positive integer"
          )
      if (
          nearest_neighbors_percent <= 0
          or nearest_neighbors_percent > 1
      ):
          raise DeepchecksValueError(
              "nearest_neighbors_percent must be a float between 0 and 1"
          )
      self.columns = columns
      self.ignore_columns = ignore_columns
      self.nearest_neighbors_percent = nearest_neighbors_percent
      self.extent_parameter = extent_parameter
      self.n_samples = n_samples
      self.n_to_show = n_to_show
      self.random_state = random_state
      self.timeout = timeout
  
file_path: deepchecks/deepchecks/tabular/checks/data_integrity/outlier_sample_detection.py
imports: import time
  from typing import List, Union
  import numpy
  from PyNomaly import loop
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.core.errors import DeepchecksProcessError, DeepchecksTimeoutError, DeepchecksValueError, NotEnoughSamplesError
  from deepchecks.tabular import Context, SingleDatasetCheck
  from deepchecks.utils import gower_distance
  from deepchecks.utils.dataframes import select_from_dataframe
  from deepchecks.utils.strings import format_number, format_percent
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 1 to create a new OutlierSampleDetection object from inherited base classes: SingleDatasetCheck with example: obj = OutlierSampleDetection(columns, ignore_columns, nearest_neighbors_percent, extent_parameter, n_samples, n_to_show, random_state, timeout)