code: def __init__(
      self,
      images_dict,
      percent_missing=0.25,
      saved_image_stride=25,
      dirname="face_images",
      scale_rows=False,
      center_rows=False,
  ):
      self.images_dict = images_dict
      self.labels = list(sorted(images_dict.keys()))
      self.images_array = np.array(
          [images_dict[k] for k in self.labels]
      ).astype("float32")
      self.image_shape = self.images_array[0].shape
      self.width, self.height = self.image_shape[:2]
      self.color = (len(self.image_shape) == 3) and (
          self.image_shape[2] == 3
      )
      if self.color:
          self.images_array = color_balance(self.images_array)
      self.n_pixels = self.width * self.height
      self.n_features = self.n_pixels * (3 if self.color else 1)
      self.n_images = len(self.images_array)
      print(
          "[ResultsTable] # images = %d, color=%s # features = %d, shape = %s"
          % (
              self.n_images,
              self.color,
              self.n_features,
              self.image_shape,
          )
      )
  
      self.flattened_array_shape = (self.n_images, self.n_features)
  
      self.flattened_images = self.images_array.reshape(
          self.flattened_array_shape
      )
  
      n_missing_pixels = int(self.n_pixels * percent_missing)
  
      missing_square_size = int(np.sqrt(n_missing_pixels))
      print(
          "[ResultsTable] n_missing_pixels = %d, missing_square_size = %d"
          % (n_missing_pixels, missing_square_size)
      )
      self.incomplete_images = remove_pixels(
          self.images_array, missing_square_size=missing_square_size
      )
      print(
          "[ResultsTable] Incomplete images shape = %s"
          % (self.incomplete_images.shape,)
      )
      self.flattened_incomplete_images = self.incomplete_images.reshape(
          self.flattened_array_shape
      )
      self.missing_mask = np.isnan(self.flattened_incomplete_images)
      self.normalizer = BiScaler(
          scale_rows=scale_rows,
          center_rows=center_rows,
          min_value=self.images_array.min(),
          max_value=self.images_array.max(),
      )
      self.incomplete_normalized = self.normalizer.fit_transform(
          self.flattened_incomplete_images
      )
  
      self.saved_image_indices = list(
          range(0, self.n_images, saved_image_stride)
      )
      self.saved_images = defaultdict(dict)
      self.dirname = dirname
      self.mse_dict = {}
      self.mae_dict = {}
  
      self.save_images(self.images_array, "original", flattened=False)
      self.save_images(
          self.incomplete_images, "incomplete", flattened=False
      )
  
imports: from os import mkdir
  from os.path import exists, join
  from collections import defaultdict
  import pylab
  from sklearn.datasets import fetch_lfw_people
  from sklearn.impute import IterativeImputer
  import numpy
  from fancyimpute import SimpleFill, IterativeSVD, SoftImpute, BiScaler, KNN
  from fancyimpute.common import masked_mae, masked_mse
label_desc: Use image node_id 1 to create a new ResultsTable object from inherited base classes: object with example: obj = ResultsTable(images_dict, percent_missing, saved_image_stride, dirname, scale_rows, center_rows)