docstr: Locate saved Experiments that are compatible with the given constraints
  
  Parameters
  ----------
  algorithm_name: String
      Name of the algorithm whose hyperparameters are being optimized
  module_name: String
      Name of the module from whence the algorithm being used came
  cross_experiment_key: String
      :attr:`hyperparameter_hunter.environment.Environment.cross_experiment_key` produced by
      the current `Environment`
  target_metric: Tuple
      Path denoting the metric to be used. The first value should be one of {"oof",
      "holdout", "in_fold"}, and the second value should be the name of a metric supplied in
      :attr:`hyperparameter_hunter.environment.Environment.metrics_params`
  space: Space
      Instance of :class:`~hyperparameter_hunter.space.space_core.Space`, defining
      hyperparameter search space constraints
  leaderboard_path: String
      Path to a leaderboard file, whose listed Experiments will be tested for compatibility
  descriptions_dir: String
      Path to a directory containing the description files of saved Experiments
  model_params: Dict
      All hyperparameters for the model, both concrete and choice. Common keys include
      "model_init_params" and "model_extra_params", both of which can be pointers to dicts of
      hyperparameters. Additionally, "feature_engineer" may be included with an instance of
      :class:`~hyperparameter_hunter.feature_engineering.FeatureEngineer`
  sort: {"target_asc", "target_desc", "chronological", "reverse_chronological"}, or int
      ... Experimental...
      How to sort the experiment results that fit within the given constraints
  
      * "target_asc": Sort from experiments with the lowest value for `target_metric` to
        those with the greatest
      * "target_desc": Sort from experiments with the highest value for `target_metric` to
        those with the lowest
      * "chronological": Sort from oldest experiments to newest
      * "reverse_chronological": Sort from newest experiments to oldest
      * int: Random seed with which to shuffle experiments
  
  Attributes
  ----------
  similar_experiments: List[Tuple[dict, Number, str]]
      Candidate saved Experiment results that are fully compatible with the template
      hyperparameters. Each value is a tuple triple of
      (<hyperparameters>, <`target_metric` value>, <candidate `experiment_id`>).
      `similar_experiments` is composed of the "finalists" from :attr:`match_status`
  match_status: Dict[str, dict]
      Record of the hyperparameters and `target_metric` values for all discovered Experiments,
      keyed by values of :attr:`experiment_ids`. Each value is a dict containing two keys:
      "params" (hyperparameter dict), and "score" (`target_metric` value number). In addition
      to these two keys, a key may be added for every `ResultFinder` method decorated by
      :func:`update_match_status`. The exact key will be the name of the method invoked (which
      will always start with "does_match", followed by the name of the hyperparameter group
      being checked). The value for each "does_match..." key is the value returned by that
      method, whose truthiness dictates whether the candidate Experiment was a successful
      match to the template hyperparameters for that group. For example, a `match_status`
      entry for one Experiment could look like this::
  
          {
              "params": <dict of hyperparameters for candidate>,
              "score": 0.42,  # `target_metric` value for candidate Experiment
              "does_match_init_params_space": True,
              "does_match_init_params_guidelines": False,
              "does_match_extra_params_space": False,
              "does_match_extra_params_guidelines": True,
              "does_match_feature_engineer": <`FeatureEngineer`>,  # Still truthy
          }
  
      Note that "model_init_params" and "model_extra_params" both check the compatibility of
      "space" choices and concrete "guidelines" separately. Conversely, "feature_engineer" is
      checked in its entirety by the single :meth:`does_match_feature_engineer`. Also note
      that "does_match..." values are not restricted to booleans. For instance,
      "does_match_feature_engineer" may be set to a reinitialized `FeatureEngineer`, which is
      still truthy, even though it's not True. If all of the "does_match..." keys have truthy
      values, the candidate is a full match and is added to :attr:`similar_experiments`
  
  Methods
  -------
  find
      Performs actual matching work by populating both :attr:`similar_experiments` and
      :attr:`match_status`
  
  See Also
  --------
  :func:`update_match_status`
      Used to decorate "does_match..." methods in order to keep a detailed record of the full
      pool of candidate Experiments in :attr:`match_status`. Aside from being used to compile
      the list of finalist :attr:`similar_experiments`, :attr:`match_status` is helpful for
      debugging purposes, specifically figuring out which aspects of a candidate are
      incompatible with the template
docstr_tok: ["Locate","saved","Experiments","that","are","compatible","with","the","given","constraints","Parameters","--","--","--","--","--","algorithm_name",":","String","Name","of","the","algorithm","whose","hyperparameters","are","being","optimized","module_name",":","String","Name","of","the","module","from","whence","the","algorithm","being","used","came","cross_experiment_key",":","String",":","attr",":","`","hyperparameter_hunter.environment.Environment.cross_experiment_key","`","produced","by","the","current","`","Environment","`","target_metric",":","Tuple","Path","denoting","the","metric","to","be","used",".","The","first","value","should","be","one","of","{","``","oof","''",",","``","holdout","''",",","``","in_fold","''","}",",","and","the","second","value","should","be","the","name","of","a","metric","supplied","in",":","attr",":","`","hyperparameter_hunter.environment.Environment.metrics_params","`","space",":","Space","Instance","of",":","class",":","`","~hyperparameter_hunter.space.space_core.Space","`",",","defining","hyperparameter","search","space","constraints","leaderboard_path",":","String","Path","to","a","leaderboard","file",",","whose","listed","Experiments","will","be","tested","for","compatibility","descriptions_dir",":","String","Path","to","a","directory","containing","the","description","files","of","saved","Experiments","model_params",":","Dict","All","hyperparameters","for","the","model",",","both","concrete","and","choice",".","Common","keys","include","``","model_init_params","''","and","``","model_extra_params","''",",","both","of","which","can","be","pointers","to","dicts","of","hyperparameters",".","Additionally",",","``","feature_engineer","''","may","be","included","with","an","instance","of",":","class",":","`","~hyperparameter_hunter.feature_engineering.FeatureEngineer","`","sort",":","{","``","target_asc","''",",","``","target_desc","''",",","``","chronological","''",",","``","reverse_chronological","''","}",",","or","int","...","Experimental","...","How","to","sort","the","experiment","results","that","fit","within","the","given","constraints","*","``","target_asc","''",":","Sort","from","experiments","with","the","lowest","value","for","`","target_metric","`","to","those","with","the","greatest","*","``","target_desc","''",":","Sort","from","experiments","with","the","highest","value","for","`","target_metric","`","to","those","with","the","lowest","*","``","chronological","''",":","Sort","from","oldest","experiments","to","newest","*","``","reverse_chronological","''",":","Sort","from","newest","experiments","to","oldest","*","int",":","Random","seed","with","which","to","shuffle","experiments","Attributes","--","--","--","--","--","similar_experiments",":","List","[","Tuple","[","dict",",","Number",",","str","]","]","Candidate","saved","Experiment","results","that","are","fully","compatible","with","the","template","hyperparameters",".","Each","value","is","a","tuple","triple","of","(","<","hyperparameters",">",",","<","`","target_metric","`","value",">",",","<","candidate","`","experiment_id","`",">",")",".","`","similar_experiments","`","is","composed","of","the","``","finalists","''","from",":","attr",":","`","match_status","`","match_status",":","Dict","[","str",",","dict","]","Record","of","the","hyperparameters","and","`","target_metric","`","values","for","all","discovered","Experiments",",","keyed","by","values","of",":","attr",":","`","experiment_ids","`",".","Each","value","is","a","dict","containing","two","keys",":","``","params","''","(","hyperparameter","dict",")",",","and","``","score","''","(","`","target_metric","`","value","number",")",".","In","addition","to","these","two","keys",",","a","key","may","be","added","for","every","`","ResultFinder","`","method","decorated","by",":","func",":","`","update_match_status","`",".","The","exact","key","will","be","the","name","of","the","method","invoked","(","which","will","always","start","with","``","does_match","''",",","followed","by","the","name","of","the","hyperparameter","group","being","checked",")",".","The","value","for","each","``","does_match","...","''","key","is","the","value","returned","by","that","method",",","whose","truthiness","dictates","whether","the","candidate","Experiment","was","a","successful","match","to","the","template","hyperparameters","for","that","group",".","For","example",",","a","`","match_status","`","entry","for","one","Experiment","could","look","like","this",":",":","{","``","params","''",":","<","dict","of","hyperparameters","for","candidate",">",",","``","score","''",":","0.42",",","#","`","target_metric","`","value","for","candidate","Experiment","``","does_match_init_params_space","''",":","True",",","``","does_match_init_params_guidelines","''",":","False",",","``","does_match_extra_params_space","''",":","False",",","``","does_match_extra_params_guidelines","''",":","True",",","``","does_match_feature_engineer","''",":","<","`","FeatureEngineer","`",">",",","#","Still","truthy","}","Note","that","``","model_init_params","''","and","``","model_extra_params","''","both","check","the","compatibility","of","``","space","''","choices","and","concrete","``","guidelines","''","separately",".","Conversely",",","``","feature_engineer","''","is","checked","in","its","entirety","by","the","single",":","meth",":","`","does_match_feature_engineer","`",".","Also","note","that","``","does_match","...","''","values","are","not","restricted","to","booleans",".","For","instance",",","``","does_match_feature_engineer","''","may","be","set","to","a","reinitialized","`","FeatureEngineer","`",",","which","is","still","truthy",",","even","though","it","'s","not","True",".","If","all","of","the","``","does_match","...","''","keys","have","truthy","values",",","the","candidate","is","a","full","match","and","is","added","to",":","attr",":","`","similar_experiments","`","Methods","--","--","--","-","find","Performs","actual","matching","work","by","populating","both",":","attr",":","`","similar_experiments","`","and",":","attr",":","`","match_status","`","See","Also","--","--","--","--",":","func",":","`","update_match_status","`","Used","to","decorate","``","does_match","...","''","methods","in","order","to","keep","a","detailed","record","of","the","full","pool","of","candidate","Experiments","in",":","attr",":","`","match_status","`",".","Aside","from","being","used","to","compile","the","list","of","finalist",":","attr",":","`","similar_experiments","`",",",":","attr",":","`","match_status","`","is","helpful","for","debugging","purposes",",","specifically","figuring","out","which","aspects","of","a","candidate","are","incompatible","with","the","template"]
code: def __init__(
      self,
      algorithm_name,
      module_name,
      cross_experiment_key,
      target_metric,
      space,
      leaderboard_path,
      descriptions_dir,
      model_params,
      sort=None,  # TODO: Unfinished - To be used in `get_scored_params`/`experiment_ids`
  ):
      """Locate saved Experiments that are compatible with the given constraints
  
      Parameters
      ----------
      algorithm_name: String
          Name of the algorithm whose hyperparameters are being optimized
      module_name: String
          Name of the module from whence the algorithm being used came
      cross_experiment_key: String
          :attr:`hyperparameter_hunter.environment.Environment.cross_experiment_key` produced by
          the current `Environment`
      target_metric: Tuple
          Path denoting the metric to be used. The first value should be one of {"oof",
          "holdout", "in_fold"}, and the second value should be the name of a metric supplied in
          :attr:`hyperparameter_hunter.environment.Environment.metrics_params`
      space: Space
          Instance of :class:`~hyperparameter_hunter.space.space_core.Space`, defining
          hyperparameter search space constraints
      leaderboard_path: String
          Path to a leaderboard file, whose listed Experiments will be tested for compatibility
      descriptions_dir: String
          Path to a directory containing the description files of saved Experiments
      model_params: Dict
          All hyperparameters for the model, both concrete and choice. Common keys include
          "model_init_params" and "model_extra_params", both of which can be pointers to dicts of
          hyperparameters. Additionally, "feature_engineer" may be included with an instance of
          :class:`~hyperparameter_hunter.feature_engineering.FeatureEngineer`
      sort: {"target_asc", "target_desc", "chronological", "reverse_chronological"}, or int
          ... Experimental...
          How to sort the experiment results that fit within the given constraints
  
          * "target_asc": Sort from experiments with the lowest value for `target_metric` to
            those with the greatest
          * "target_desc": Sort from experiments with the highest value for `target_metric` to
            those with the lowest
          * "chronological": Sort from oldest experiments to newest
          * "reverse_chronological": Sort from newest experiments to oldest
          * int: Random seed with which to shuffle experiments
  
      Attributes
      ----------
      similar_experiments: List[Tuple[dict, Number, str]]
          Candidate saved Experiment results that are fully compatible with the template
          hyperparameters. Each value is a tuple triple of
          (<hyperparameters>, <`target_metric` value>, <candidate `experiment_id`>).
          `similar_experiments` is composed of the "finalists" from :attr:`match_status`
      match_status: Dict[str, dict]
          Record of the hyperparameters and `target_metric` values for all discovered Experiments,
          keyed by values of :attr:`experiment_ids`. Each value is a dict containing two keys:
          "params" (hyperparameter dict), and "score" (`target_metric` value number). In addition
          to these two keys, a key may be added for every `ResultFinder` method decorated by
          :func:`update_match_status`. The exact key will be the name of the method invoked (which
          will always start with "does_match", followed by the name of the hyperparameter group
          being checked). The value for each "does_match..." key is the value returned by that
          method, whose truthiness dictates whether the candidate Experiment was a successful
          match to the template hyperparameters for that group. For example, a `match_status`
          entry for one Experiment could look like this::
  
              {
                  "params": <dict of hyperparameters for candidate>,
                  "score": 0.42,  # `target_metric` value for candidate Experiment
                  "does_match_init_params_space": True,
                  "does_match_init_params_guidelines": False,
                  "does_match_extra_params_space": False,
                  "does_match_extra_params_guidelines": True,
                  "does_match_feature_engineer": <`FeatureEngineer`>,  # Still truthy
              }
  
          Note that "model_init_params" and "model_extra_params" both check the compatibility of
          "space" choices and concrete "guidelines" separately. Conversely, "feature_engineer" is
          checked in its entirety by the single :meth:`does_match_feature_engineer`. Also note
          that "does_match..." values are not restricted to booleans. For instance,
          "does_match_feature_engineer" may be set to a reinitialized `FeatureEngineer`, which is
          still truthy, even though it's not True. If all of the "does_match..." keys have truthy
          values, the candidate is a full match and is added to :attr:`similar_experiments`
  
      Methods
      -------
      find
          Performs actual matching work by populating both :attr:`similar_experiments` and
          :attr:`match_status`
  
      See Also
      --------
      :func:`update_match_status`
          Used to decorate "does_match..." methods in order to keep a detailed record of the full
          pool of candidate Experiments in :attr:`match_status`. Aside from being used to compile
          the list of finalist :attr:`similar_experiments`, :attr:`match_status` is helpful for
          debugging purposes, specifically figuring out which aspects of a candidate are
          incompatible with the template"""
      self.algorithm_name = algorithm_name
      self.module_name = module_name
      self.cross_experiment_key = cross_experiment_key
      self.target_metric = target_metric
      self.space = space
      self.leaderboard_path = leaderboard_path
      self.descriptions_dir = descriptions_dir
      self.model_params = model_params
      self.sort = sort
  
      self._experiment_ids = None
      self._mini_spaces = None
  
      self.match_status = {}
      self.similar_experiments = []
  
imports: from hyperparameter_hunter.feature_engineering import EngineerStep, FeatureEngineer
  from hyperparameter_hunter.i_o.exceptions import IncompatibleCandidateError
  from hyperparameter_hunter.compat.keras_helper import keras_callback_to_dict, keras_initializer_to_dict
  from hyperparameter_hunter.settings import G
  from hyperparameter_hunter.space.dimensions import Categorical, RejectedOptional
  from hyperparameter_hunter.space.space_core import Space
  from hyperparameter_hunter.utils.boltons_utils import remap, get_path
  from hyperparameter_hunter.utils.general_utils import multi_visit
  from hyperparameter_hunter.utils.optimization_utils import does_fit_in_space, get_ids_by, get_scored_params
  from copy import deepcopy
  from numbers import Number
  from pathlib import Path
  from typing import Dict, List, Tuple, Union
  import wrapt
label_desc: Use image node_id 1 to create a new ResultFinder object  with example: obj = ResultFinder(algorithm_name, module_name, cross_experiment_key, target_metric, space, leaderboard_path, descriptions_dir, model_params, sort)