class_docstr: `LowProFool` attack.
  
  | Paper link: https://arxiv.org/abs/1911.03274
class_docstr_tok: ["`","LowProFool","`","attack",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1911.03274"]
docstr: This function allows one to easily calculate the feature importance vector using the pre-specified function,
  in case it wasn't passed at initialization.
  
  :param x: Design matrix of the dataset used to train the classifier.
  :param y: Labels of the dataset used to train the classifier.
  :param importance_array: Array providing features' importance score.
  :param normalize: Assure that feature importance values sum to 1.
  :return: LowProFool instance itself.
docstr_tok: ["This","function","allows","one","to","easily","calculate","the","feature","importance","vector","using","the","pre-specified","function",",","in","case","it","was","n't","passed","at","initialization",".",":","param","x",":","Design","matrix","of","the","dataset","used","to","train","the","classifier",".",":","param","y",":","Labels","of","the","dataset","used","to","train","the","classifier",".",":","param","importance_array",":","Array","providing","features","'","importance","score",".",":","param","normalize",":","Assure","that","feature","importance","values","sum","to","1.",":","return",":","LowProFool","instance","itself","."]
code: def fit_importances(
      self,
      x: Optional[np.ndarray] = None,
      y: Optional[np.ndarray] = None,
      importance_array: Optional[np.ndarray] = None,
      normalize: Optional[bool] = True,
  ):
      """
      This function allows one to easily calculate the feature importance vector using the pre-specified function,
      in case it wasn't passed at initialization.
  
      :param x: Design matrix of the dataset used to train the classifier.
      :param y: Labels of the dataset used to train the classifier.
      :param importance_array: Array providing features' importance score.
      :param normalize: Assure that feature importance values sum to 1.
      :return: LowProFool instance itself.
      """
      if importance_array is not None:
          # Use a pre-calculated vector of feature importance.
          if np.array(importance_array).shape == (self.n_features,):
              self.importance_vec = np.array(importance_array)
          else:  # pragma: no cover
              raise ValueError(
                  "Feature has to be one-dimensional array of size (n_features, )."
              )
  
      elif self.importance_vec is None:
          # Apply a function specified at the LowProFool instance initialization.
          self.__calculate_feature_importances(np.array(x), np.array(y))
  
      if normalize:
          # Make sure that importance vector sums to 1.
          if self.importance_vec is not None:
              self.importance_vec = np.array(
                  self.importance_vec
              ) / np.sum(self.importance_vec)
          else:
              raise ValueError("Unexpected `None` detected.")
  
      return self
  
imports: import logging
  from typing import Callable, Optional, Union, TYPE_CHECKING
  import numpy
  from scipy.stats import pearsonr
  from tqdm.auto import trange
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import LossGradientsMixin
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
label_desc: Use image node_id 7 for calling the LowProFool obj's underlying member method code with example usage: obj.fit_importances(x, y, importance_array, normalize) and returns: self