class_docstr: Abstraction for a feature matrix in which the columns are grouped into
  blocks.
  
  Parameters
  ----------
  data_blocks: list of ndarray
      Blocks of feature columns
  common_block: ndarray
      A set of feature columns that should be common to all blocks
class_docstr_tok: ["Abstraction","for","a","feature","matrix","in","which","the","columns","are","grouped","into","blocks",".","Parameters","--","--","--","--","--","data_blocks",":","list","of","ndarray","Blocks","of","feature","columns","common_block",":","ndarray","A","set","of","feature","columns","that","should","be","common","to","all","blocks"]
docstr: Modify the data by either imputing the mean of each feature in block k
  (keep_rest) or imputing the mean of each feature not in block k
  (keep_k). Return the full data matrix with the modified data.
  
  Parameters
  ----------
  k: int
      The index of the feature block not to modify
  mode: string in {"keep_k", "keep_rest"}
      Mode for the method. "keep_k" imputes the mean of each feature not
      in block k, "keep_rest" imputes the mean of each feature in block k
  
  Returns
  -------
  all_data: ndarray
      Returns the data matrix obtained by concatenating all feature
      blocks together
docstr_tok: ["Modify","the","data","by","either","imputing","the","mean","of","each","feature","in","block","k","(","keep_rest",")","or","imputing","the","mean","of","each","feature","not","in","block","k","(","keep_k",")",".","Return","the","full","data","matrix","with","the","modified","data",".","Parameters","--","--","--","--","--","k",":","int","The","index","of","the","feature","block","not","to","modify","mode",":","string","in","{","``","keep_k","''",",","``","keep_rest","''","}","Mode","for","the","method",".","``","keep_k","''","imputes","the","mean","of","each","feature","not","in","block","k",",","``","keep_rest","''","imputes","the","mean","of","each","feature","in","block","k","Returns","--","--","--","-","all_data",":","ndarray","Returns","the","data","matrix","obtained","by","concatenating","all","feature","blocks","together"]
code: def get_modified_data(self, k, mode="keep_k"):
      """
      Modify the data by either imputing the mean of each feature in block k
      (keep_rest) or imputing the mean of each feature not in block k
      (keep_k). Return the full data matrix with the modified data.
  
      Parameters
      ----------
      k: int
          The index of the feature block not to modify
      mode: string in {"keep_k", "keep_rest"}
          Mode for the method. "keep_k" imputes the mean of each feature not
          in block k, "keep_rest" imputes the mean of each feature in block k
  
      Returns
      -------
      all_data: ndarray
          Returns the data matrix obtained by concatenating all feature
          blocks together
      """
      modified_blocks = [
          np.outer(np.ones(self.n_samples), self._means[i])
          for i in range(self.n_blocks)
      ]
      if mode == "keep_k":
          data_blocks = [
              self._data_blocks[i] if i == k else modified_blocks[i]
              for i in range(self.n_blocks)
          ]
      elif mode == "keep_rest":
          data_blocks = [
              modified_blocks[i] if i == k else self._data_blocks[i]
              for i in range(self.n_blocks)
          ]
      else:
          raise ValueError("Unsupported mode.")
      if self._common_block is None:
          all_data = np.hstack(data_blocks)
      else:
          all_data = np.hstack(data_blocks + [self._common_block])
      return all_data
  
imports: from abc import ABC, abstractmethod
  import numpy
  from collections import defaultdict
  from sklearn.ensemble import BaseEnsemble
  from sklearn.ensemble._forest import _generate_unsampled_indices, _generate_sample_indices
  from .local_stumps import make_stumps, tree_feature_transform
label_desc: Use image node_id 8 for calling the BlockPartitionedData obj's underlying member method code with example usage: obj.get_modified_data(k, mode) and returns: all_data