class_docstr: Calculate drift between train dataset and test dataset per image property, using statistical measures.
  
  Check calculates a drift score for each image property in test dataset, by comparing its distribution to the train
  dataset.
  
  For numerical distributions, we use the Kolmogorov-Smirnov statistic.
  See https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test
  We also support Earth Mover's Distance (EMD).
  See https://en.wikipedia.org/wiki/Wasserstein_metric
  
  Parameters
  ----------
  image_properties : List[Dict[str, Any]], default: None
      List of properties. Replaces the default deepchecks properties.
      Each property is a dictionary with keys ``'name'`` (str), ``method`` (Callable) and ``'output_type'`` (str),
      representing attributes of said method. 'output_type' must be one of:
  
      - ``'numerical'`` - for continuous ordinal outputs.
      - ``'categorical'`` - for discrete, non-ordinal outputs. These can still be numbers,
        but these numbers do not have inherent value.
  
      For more on image / label properties, see the guide about :ref:`vision__properties_guide`.
  margin_quantile_filter: float, default: 0.025
      float in range [0,0.5), representing which margins (high and low quantiles) of the distribution will be filtered
      out of the EMD calculation. This is done in order for extreme values not to affect the calculation
      disproportionally. This filter is applied to both distributions, in both margins.
  min_category_size_ratio: float, default 0.01
      minimum size ratio for categories. Categories with size ratio lower than this number are binned
      into an "Other" category.
  max_num_categories_for_drift: int, default: None
      Only for discrete properties. Max number of allowed categories. If there are more,
      they are binned into an "Other" category. This limit applies for both drift calculation and distribution plots.
  max_num_categories_for_display: int, default: 10
      Max number of categories to show in plot.
  show_categories_by: str, default: 'largest_difference'
      Specify which categories to show for categorical features' graphs, as the number of shown categories is limited
      by max_num_categories_for_display. Possible values:
  
      - 'train_largest': Show the largest train categories.
      - 'test_largest': Show the largest test categories.
      - 'largest_difference': Show the largest difference between categories.
  numerical_drift_method: str, default: "KS"
      decides which method to use on numerical variables. Possible values are:
      "EMD" for Earth Mover's Distance (EMD), "KS" for Kolmogorov-Smirnov (KS).
  aggregation_method: str, default: 'max'
      {property_aggregation_method_argument:2*indent}
  min_samples : int , default: 10
      Minimum number of samples required to calculate the drift score. If there are not enough samples for either
      train or test, the check will return None for that property. If there are not enough samples for all properties,
      the check will raise a ``NotEnoughSamplesError`` exception.
  {additional_check_init_params:2*indent}
class_docstr_tok: ["Calculate","drift","between","train","dataset","and","test","dataset","per","image","property",",","using","statistical","measures",".","Check","calculates","a","drift","score","for","each","image","property","in","test","dataset",",","by","comparing","its","distribution","to","the","train","dataset",".","For","numerical","distributions",",","we","use","the","Kolmogorov-Smirnov","statistic",".","See","https",":","\/\/en.wikipedia.org\/wiki\/Kolmogorov","%","E2","%","80","%","93Smirnov_test","We","also","support","Earth","Mover","'s","Distance","(","EMD",")",".","See","https",":","\/\/en.wikipedia.org\/wiki\/Wasserstein_metric","Parameters","--","--","--","--","--","image_properties",":","List","[","Dict","[","str",",","Any","]","]",",","default",":","None","List","of","properties",".","Replaces","the","default","deepchecks","properties",".","Each","property","is","a","dictionary","with","keys","``","'name","'","``","(","str",")",",","``","method","``","(","Callable",")","and","``","'output_type","'","``","(","str",")",",","representing","attributes","of","said","method",".","'output_type","'","must","be","one","of",":","-","``","'numerical","'","``","-","for","continuous","ordinal","outputs",".","-","``","'categorical","'","``","-","for","discrete",",","non-ordinal","outputs",".","These","can","still","be","numbers",",","but","these","numbers","do","not","have","inherent","value",".","For","more","on","image","\/","label","properties",",","see","the","guide","about",":","ref",":","`","vision__properties_guide","`",".","margin_quantile_filter",":","float",",","default",":","0.025","float","in","range","[","0,0.5",")",",","representing","which","margins","(","high","and","low","quantiles",")","of","the","distribution","will","be","filtered","out","of","the","EMD","calculation",".","This","is","done","in","order","for","extreme","values","not","to","affect","the","calculation","disproportionally",".","This","filter","is","applied","to","both","distributions",",","in","both","margins",".","min_category_size_ratio",":","float",",","default","0.01","minimum","size","ratio","for","categories",".","Categories","with","size","ratio","lower","than","this","number","are","binned","into","an","``","Other","''","category",".","max_num_categories_for_drift",":","int",",","default",":","None","Only","for","discrete","properties",".","Max","number","of","allowed","categories",".","If","there","are","more",",","they","are","binned","into","an","``","Other","''","category",".","This","limit","applies","for","both","drift","calculation","and","distribution","plots",".","max_num_categories_for_display",":","int",",","default",":","10","Max","number","of","categories","to","show","in","plot",".","show_categories_by",":","str",",","default",":","'largest_difference'","Specify","which","categories","to","show","for","categorical","features","'","graphs",",","as","the","number","of","shown","categories","is","limited","by","max_num_categories_for_display",".","Possible","values",":","-","'train_largest","'",":","Show","the","largest","train","categories",".","-","'test_largest","'",":","Show","the","largest","test","categories",".","-","'largest_difference","'",":","Show","the","largest","difference","between","categories",".","numerical_drift_method",":","str",",","default",":","``","KS","''","decides","which","method","to","use","on","numerical","variables",".","Possible","values","are",":","``","EMD","''","for","Earth","Mover","'s","Distance","(","EMD",")",",","``","KS","''","for","Kolmogorov-Smirnov","(","KS",")",".","aggregation_method",":","str",",","default",":","'max'","{","property_aggregation_method_argument:2","*","indent","}","min_samples",":","int",",","default",":","10","Minimum","number","of","samples","required","to","calculate","the","drift","score",".","If","there","are","not","enough","samples","for","either","train","or","test",",","the","check","will","return","None","for","that","property",".","If","there","are","not","enough","samples","for","all","properties",",","the","check","will","raise","a","``","NotEnoughSamplesError","``","exception",".","{","additional_check_init_params:2","*","indent","}"]
code: def __init__(
      self,
      image_properties: t.List[t.Dict[str, t.Any]] = None,
      margin_quantile_filter: float = 0.025,
      max_num_categories_for_drift: int = None,
      min_category_size_ratio: float = 0.01,
      max_num_categories_for_display: int = 10,
      show_categories_by: str = "largest_difference",
      numerical_drift_method: str = "KS",
      aggregation_method: t.Optional[str] = "max",
      min_samples: t.Optional[int] = 10,
      n_samples: t.Optional[int] = 10000,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.image_properties = image_properties
      self.margin_quantile_filter = margin_quantile_filter
      self.max_num_categories_for_drift = max_num_categories_for_drift
      self.min_category_size_ratio = min_category_size_ratio
      self.max_num_categories_for_display = (
          max_num_categories_for_display
      )
      self.show_categories_by = show_categories_by
      self.numerical_drift_method = numerical_drift_method
      self.min_samples = min_samples
      self.aggregation_method = aggregation_method
      self.min_samples = min_samples
      self.n_samples = n_samples
  
      self._train_properties = None
      self._test_properties = None
  
imports: import typing
  from collections import defaultdict
  import pandas
  from deepchecks.core import CheckResult, DatasetKind
  from deepchecks.core.errors import DeepchecksValueError, NotEnoughSamplesError
  from deepchecks.core.reduce_classes import ReducePropertyMixin
  from deepchecks.utils.distribution.drift import calc_drift_and_plot, drift_condition, get_drift_plot_sidenote
  from deepchecks.vision._shared_docs import docstrings
  from deepchecks.vision.base_checks import TrainTestCheck
  from deepchecks.vision.context import Context
  from deepchecks.vision.utils.image_properties import default_image_properties
  from deepchecks.vision.utils.vision_properties import PropertiesInputType
  from deepchecks.vision.vision_data.batch_wrapper import BatchWrapper
label_desc: Use image node_id 1 to create a new ImagePropertyDrift object from inherited base classes: TrainTestCheck, ReducePropertyMixin with example: obj = ImagePropertyDrift(image_properties, margin_quantile_filter, max_num_categories_for_drift, min_category_size_ratio, max_num_categories_for_display, show_categories_by, numerical_drift_method, aggregation_method, min_samples, n_samples)