docstr: Estimate local feature importance scores for the given inputs.
  
  :param query_instances: A list of inputs for which to compute the
                          feature importances. These can be provided as a dataframe.
  :param cf_examples_list: If precomputed, a list of counterfactual
                           examples for every input point. If cf_examples_list is provided, then
                           all the following parameters are ignored.
  :param total_CFs: The number of counterfactuals to generate per input
                    (default is 10)
  :param other_parameters: These are the same as the
                           generate_counterfactuals method.
  
  :returns: An object of class CounterfactualExplanations that includes
            the list of counterfactuals per input, local feature importances per
            input, and the global feature importance summarized over all inputs.
code: def local_feature_importance(
      self,
      query_instances,
      cf_examples_list=None,
      total_CFs=10,
      desired_class="opposite",
      desired_range=None,
      permitted_range=None,
      features_to_vary="all",
      stopping_threshold=0.5,
      posthoc_sparsity_param=0.1,
      posthoc_sparsity_algorithm="linear",
      **kwargs,
  ):
      """Estimate local feature importance scores for the given inputs.
  
      :param query_instances: A list of inputs for which to compute the
                              feature importances. These can be provided as a dataframe.
      :param cf_examples_list: If precomputed, a list of counterfactual
                               examples for every input point. If cf_examples_list is provided, then
                               all the following parameters are ignored.
      :param total_CFs: The number of counterfactuals to generate per input
                        (default is 10)
      :param other_parameters: These are the same as the
                               generate_counterfactuals method.
  
      :returns: An object of class CounterfactualExplanations that includes
                the list of counterfactuals per input, local feature importances per
                input, and the global feature importance summarized over all inputs.
      """
      self._validate_counterfactual_configuration(
          query_instances=query_instances,
          total_CFs=total_CFs,
          desired_class=desired_class,
          desired_range=desired_range,
          permitted_range=permitted_range,
          features_to_vary=features_to_vary,
          stopping_threshold=stopping_threshold,
          posthoc_sparsity_param=posthoc_sparsity_param,
          posthoc_sparsity_algorithm=posthoc_sparsity_algorithm,
          kwargs=kwargs,
      )
      if cf_examples_list is not None:
          if any(
              [
                  len(cf_examples.final_cfs_df) < 10
                  for cf_examples in cf_examples_list
              ]
          ):
              raise UserConfigValidationException(
                  "The number of counterfactuals generated per query instance should be "
                  "greater than or equal to 10 to compute feature importance for all query points"
              )
      elif total_CFs < 10:
          raise UserConfigValidationException(
              "The number of counterfactuals requested per "
              "query instance should be greater than or equal to 10 "
              "to compute feature importance for all query points"
          )
      importances = self.feature_importance(
          query_instances,
          cf_examples_list=cf_examples_list,
          total_CFs=total_CFs,
          local_importance=True,
          global_importance=False,
          desired_class=desired_class,
          desired_range=desired_range,
          permitted_range=permitted_range,
          features_to_vary=features_to_vary,
          stopping_threshold=stopping_threshold,
          posthoc_sparsity_param=posthoc_sparsity_param,
          posthoc_sparsity_algorithm=posthoc_sparsity_algorithm,
          **kwargs,
      )
      return importances
  
imports: import pickle
  from abc import ABC, abstractmethod
  from collections.abc import Iterable
  from typing import Any, List
  import numpy
  import pandas
  from raiutils.exceptions import UserConfigValidationException
  from sklearn.neighbors import KDTree
  from tqdm import tqdm
  from dice_ml.constants import ModelTypes, _PostHocSparsityTypes
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
label_desc: Use image node_id 8 for calling the ExplainerBase obj's underlying member method code with example usage: obj.local_feature_importance(query_instances, cf_examples_list, total_CFs, desired_class, desired_range, permitted_range, features_to_vary, stopping_threshold, posthoc_sparsity_param, posthoc_sparsity_algorithm) and returns: importances