class_docstr: k-Nearest Neighbors imputation for arrays with missing data.
  Works only on dense arrays with at most a few thousand rows.
  
  Assumes that each feature has been centered and rescaled to have
  mean 0 and variance 1.
  
  Inspired by the implementation of kNNImpute from the R package
  imputation.
  See here:
  https://www.rdocumentation.org/packages/imputation/versions/2.0.3/topics/kNNImpute
code: def solve(self, X, missing_mask):
      X = check_array(X, force_all_finite=False)
  
      if self.orientation == "columns":
          X = X.T
          missing_mask = missing_mask.T
  
      elif self.orientation != "rows":
          raise ValueError(
              "Orientation must be either 'rows' or 'columns', got: %s"
              % (self.orientation,)
          )
  
      X_imputed = self._impute_fn(
          X=X,
          missing_mask=missing_mask,
          k=self.k,
          verbose=self.verbose,
          print_interval=self.print_interval,
      )
  
      failed_to_impute = np.isnan(X_imputed)
      n_missing_after_imputation = failed_to_impute.sum()
      if n_missing_after_imputation != 0:
          if self.verbose:
              print(
                  "[KNN] Warning: %d/%d still missing after imputation, replacing with 0"
                  % (
                      n_missing_after_imputation,
                      X.shape[0] * X.shape[1],
                  )
              )
          X_imputed[failed_to_impute] = X[failed_to_impute]
  
      if self.orientation == "columns":
          X_imputed = X_imputed.T
  
      return X_imputed
  
imports: import numpy
  from knnimpute import knn_impute_few_observed, knn_impute_with_argpartition
  from sklearn.utils import check_array
  from .solver import Solver
label_desc: Use image node_id 2 for calling the KNN obj's underlying member method code with example usage: obj.solve(X, missing_mask) and returns: X_imputed