ectools/NWKR.py
def predict(self, X):
        """Predict outcomes from observations X, and also calculate standard deviations for the predictions.

        Args:
            X: a np.ndarray of floats, of dimension 2.

        Returns:
            predictions: a np.ndarray with a prediction for each row in X
            predictions_std: standard deviations on the predictions
        """
        assert X.ndim == 2
        assert X.shape[1] == self.X_t.shape[1]
        if self.njobs == 1:
            predictions, stds = _predict(X, self.X_t, self.y_t, self.bw, self.kernel)
        else:  # parallelize
            def parallel_helper(X):
                return _predict(X, self.X_t, self.y_t, self.bw, self.kernel)

            result = parallel_wrapper(fcn=parallel_helper,
                                      iterable=np.array_split(X, self.njobs, axis=0),
                                      n_jobs=self.njobs, progress=False)
            predictions, stds = zip(*result)
            predictions = np.hstack(predictions)
            stds = np.hstack(stds)
        return predictions, stds
Predict outcomes from observations X, and also calculate standard deviations for the predictions.

        Args:
            X: a np.ndarray of floats, of dimension 2.

        Returns:
            predictions: a np.ndarray with a prediction for each row in X
            predictions_std: standard deviations on the predictions
        
Predict outcomes from observations X, and also calculate standard deviations for the predictions.
Predict outcomes from observations X and also calculate standard deviations for the predictions .
def predict(self, X):
        assert X.ndim == 2
        assert X.shape[1] == self.X_t.shape[1]
        if self.njobs == 1:
            predictions, stds = _predict(X, self.X_t, self.y_t, self.bw, self.kernel)
        else:  
            def parallel_helper(X):
                return _predict(X, self.X_t, self.y_t, self.bw, self.kernel)
            result = parallel_wrapper(fcn=parallel_helper,
                                      iterable=np.array_split(X, self.njobs, axis=0),
                                      n_jobs=self.njobs, progress=False)
            predictions, stds = zip(*result)
            predictions = np.hstack(predictions)
            stds = np.hstack(stds)
        return predictions, stds
def predict ( self , X ) : assert X . ndim == 2 assert X . shape [ 1 ] == self . X_t . shape [ 1 ] if self . njobs == 1 : predictions , stds = _predict ( X , self . X_t , self . y_t , self . bw , self . kernel ) else : def parallel_helper ( X ) : return _predict ( X , self . X_t , self . y_t , self . bw , self . kernel ) result = parallel_wrapper ( fcn = parallel_helper , iterable = np . array_split ( X , self . njobs , axis = 0 ) , n_jobs = self . njobs , progress = False ) predictions , stds = zip ( * result ) predictions = np . hstack ( predictions ) stds = np . hstack ( stds ) return predictions , stds
Predict outcomes from observations X, and also calculate standard deviations for the predictions.
Predict outcomes from observations X and also calculate standard deviations for the predictions .
"""Predict outcomes from observations X, and also calculate standard deviations for the predictions.

        Args:
            X: a np.ndarray of floats, of dimension 2.

        Returns:
            predictions: a np.ndarray with a prediction for each row in X
            predictions_std: standard deviations on the predictions
        """ # parallelize
a np.ndarray with a prediction for each row in X
predictions_std: standard deviations on the predictions
a np . ndarray with a prediction for each row in X predictions_std : standard deviations on the predictions
predictions
self
X
a np.ndarray of floats, of dimension 2.
a np . ndarray of floats of dimension 2 .