class_docstr: KNearestNeighbors model (scikit-learn): https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html
class_docstr_tok: ["KNearestNeighbors","model","(","scikit-learn",")",":","https",":","\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.neighbors.KNeighborsClassifier.html"]
code: def _fit(
      self,
      X,
      y,
      num_cpus=-1,
      time_limit=None,
      sample_weight=None,
      **kwargs,
  ):
      time_start = time.time()
      X = self.preprocess(X)
      params = self._get_model_params()
      if "n_jobs" not in params:
          params["n_jobs"] = num_cpus
      if sample_weight is not None:  # TODO: support
          logger.log(
              15,
              "sample_weight not yet supported for KNNModel, this model will ignore them in training.",
          )
  
      num_rows_max = len(X)
      # FIXME: v0.1 Must store final num rows for refit_full or else will use everything! Worst case refit_full could train far longer than the original model.
      if time_limit is None or num_rows_max <= 10000:
          self.model = self._get_model_type()(**params).fit(X, y)
      else:
          self.model = self._fit_with_samples(
              X=X,
              y=y,
              model_params=params,
              time_limit=time_limit - (time.time() - time_start),
          )
  
imports: import logging
  import math
  import time
  from typing import Dict, Union
  import numpy
  from autogluon.common.features.types import R_FLOAT, R_INT, S_BOOL
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION
  from autogluon.core.models import AbstractModel
  from autogluon.core.utils.exceptions import NotEnoughMemoryError
  from autogluon.core.utils.utils import normalize_pred_probas
label_desc: Use image node_id 9 for calling the KNNModel obj's underlying member method code with example usage: obj._fit(X, y, num_cpus, time_limit, sample_weight) without return types