def METHOD_NAME(self, X, y=None, queue=None):
    onedal_params = {
        "n_neighbors": self.n_neighbors,
        "algorithm": self.algorithm,
        "metric": self.effective_metric_,
        "p": self.effective_metric_params_["p"],
    }
    try:
        requires_y = self._get_tags()["requires_y"]
    except KeyError:
        requires_y = False
    self._onedal_estimator = onedal_NearestNeighbors(**onedal_params)
    self._onedal_estimator.requires_y = requires_y
    self._onedal_estimator.effective_metric_ = self.effective_metric_
    self._onedal_estimator.effective_metric_params_ = self.effective_metric_params_
    self._onedal_estimator.fit(X, y, queue=queue)
    self._save_attributes()