class_docstr: Fill in missing each missing row/column value by averaging across the
  k-nearest neighbors columns (taking into account missing data when
  computing column similarities and choosing which neighbors to inspect).
  
  Currently does not inherit from Solver since it expects sparse inputs in
  the form of nested dictionaries.
docstr: Keys of nested dictionaries can be arbitrary objects.
docstr_tok: ["Keys","of","nested","dictionaries","can","be","arbitrary","objects","."]
code: def complete_dict(self, values_dict):
      """
      Keys of nested dictionaries can be arbitrary objects.
      """
      if self.orientation != "rows":
          values_dict = transpose_nested_dictionary(values_dict)
  
      row_keys, column_keys = collect_nested_keys(values_dict)
      if self.verbose:
          print(
              "[SimilarityWeightedAveraging] # rows = %d"
              % (len(row_keys))
          )
          print(
              "[SimilarityWeightedAveraging] # columns = %d"
              % (len(column_keys))
          )
      (
          similarities,
          overlaps,
          weights,
      ) = self.jacard_similarity_from_nested_dicts(values_dict)
      if self.verbose:
          print(
              "[SimilarityWeightedAveraging] Computed %d similarities between rows"
              % (len(similarities),)
          )
      column_to_row_values = reverse_lookup_from_nested_dict(
          values_dict
      )
  
      result = defaultdict(dict)
  
      exponent = self.similarity_exponent
      shrinkage_value = self.shrinkage_value
      for i, row_key in enumerate(row_keys):
          for (
              column_key,
              value_triplets,
          ) in column_to_row_values.items():
              total = 0
              denom = shrinkage_value
              for other_row_key, y in value_triplets:
                  sample_weight = 1.0
                  sim = similarities.get((row_key, other_row_key), 0)
                  combined_weight = sim**exponent
                  combined_weight *= sample_weight
                  total += combined_weight * y
                  denom += combined_weight
              if denom > shrinkage_value:
                  result[row_key][column_key] = total / denom
      if self.orientation != "rows":
          result = transpose_nested_dictionary(result)
      return result
  
file_path: fancyimpute/fancyimpute/similarity_weighted_averaging.py
imports: from collections import defaultdict
  from sklearn.utils import check_array
  import numpy
  from .dictionary_helpers import collect_nested_keys, reverse_lookup_from_nested_dict, matrix_to_nested_dictionary, transpose_nested_dictionary
label_desc: Use image node_id 3 for calling the SimilarityWeightedAveraging obj's underlying member method code with example usage: obj.complete_dict(values_dict) and returns: result