docstr: Estimate global 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 local_importance: Binary flag indicating whether local feature
                           importance values should also be returned for each query instance.
  :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 global_feature_importance(
      self,
      query_instances,
      cf_examples_list=None,
      total_CFs=10,
      local_importance=True,
      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 global 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 local_importance: Binary flag indicating whether local feature
                               importance values should also be returned for each query instance.
      :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 query_instances is not None and len(query_instances) < 10:
          raise UserConfigValidationException(
              "The number of query instances should be greater than or equal to 10 "
              "to compute global feature importance over all query points"
          )
      if cf_examples_list is not None:
          if len(cf_examples_list) < 10:
              raise UserConfigValidationException(
                  "The number of points for which counterfactuals generated should be "
                  "greater than or equal to 10 "
                  "to compute global feature importance"
              )
          elif 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 global feature importance over 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 global feature importance over all query points"
          )
      importances = self.feature_importance(
          query_instances,
          cf_examples_list=cf_examples_list,
          total_CFs=total_CFs,
          local_importance=local_importance,
          global_importance=True,
          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 9 for calling the ExplainerBase obj's underlying member method code with example usage: obj.global_feature_importance(query_instances, cf_examples_list, total_CFs, local_importance, desired_class, desired_range, permitted_range, features_to_vary, stopping_threshold, posthoc_sparsity_param, posthoc_sparsity_algorithm) and returns: importances