class_docstr: Nadaraya-Watson Kernel Regression
  
  This is basically a gaussian-weighted moving average of points
  
  Parameters
  ----------
  kernel : string
      kernel is either "gaussian", or one of the kernels available in
      sklearn.metrics.pairwise.
  h : float or array_like
      width of kernel.  If array, its length must be the number of
      dimensions in the training data
  
  Additional keyword arguments are passed to the kernel.
code: def predict(self, X):
      X = np.asarray(X)
      if X.ndim != 2:
          raise ValueError("X must be two-dimensional")
  
      if X.shape[1] != self.X.shape[1]:
          raise ValueError(
              "dimensions of X do not match training dimension"
          )
  
      if self.kernel == "gaussian":
          # wrangle gaussian into scikit-learn's 'rbf' kernel
          h = np.asarray(self.h)
          gamma = 0.5 / h / h
          K = pairwise_kernels(X, self.X, metric="rbf", gamma=gamma)
  
      else:
          K = pairwise_kernels(
              X, self.X, metric=self.kernel, **self.kwargs
          )
  
      K /= self.dy**2
  
      return (K * self.y).sum(1) / K.sum(1)
  
file_path: astroML/astroML/linear_model/kernel_regression.py
imports: import numpy
  from sklearn.base import BaseEstimator
  from sklearn.metrics import pairwise_kernels
label_desc: Use image node_id 3 for calling the NadarayaWatson obj's underlying member method code with example usage: obj.predict(X) and returns: unknown