ectools/NWKR.py
def fit(self, X, y):
        """Fit using observations X and outcomes y.

        Args:
            X: a np.ndarray of floats of dimension 2
            y: a np.ndarray of floats with the same number of elements as the rows of X

        Returns:
            None

        """
        assert X.ndim == 2
        assert X.shape[0] == y.size
        if self.multiple_bw:
            # check that bandwidth has same no. of elements as no. of features in X
            assert len(self.bw.shape) == 1 and self.bw.size == X.shape[1]
        # only keep complete samples
        keep = np.invert(np.isnan(X).sum(axis=1) > 0) & np.isfinite(y)
        assert keep.sum()>0
        self.X_t = X[keep]
        self.y_t = y[keep]
        self.n = self.X_t.shape[0]
Fit using observations X and outcomes y.

        Args:
            X: a np.ndarray of floats of dimension 2
            y: a np.ndarray of floats with the same number of elements as the rows of X

        Returns:
            None

        
Fit using observations X and outcomes y.
Fit using observations X and outcomes y .
def fit(self, X, y):
        assert X.ndim == 2
        assert X.shape[0] == y.size
        if self.multiple_bw:
            assert len(self.bw.shape) == 1 and self.bw.size == X.shape[1]
        keep = np.invert(np.isnan(X).sum(axis=1) > 0) & np.isfinite(y)
        assert keep.sum()>0
        self.X_t = X[keep]
        self.y_t = y[keep]
        self.n = self.X_t.shape[0]
def fit ( self , X , y ) : assert X . ndim == 2 assert X . shape [ 0 ] == y . size if self . multiple_bw : assert len ( self . bw . shape ) == 1 and self . bw . size == X . shape [ 1 ] keep = np . invert ( np . isnan ( X ) . sum ( axis = 1 ) > 0 ) & np . isfinite ( y ) assert keep . sum ( ) > 0 self . X_t = X [ keep ] self . y_t = y [ keep ] self . n = self . X_t . shape [ 0 ]
Fit using observations X and outcomes y.
Fit using observations X and outcomes y .
"""Fit using observations X and outcomes y.

        Args:
            X: a np.ndarray of floats of dimension 2
            y: a np.ndarray of floats with the same number of elements as the rows of X

        Returns:
            None

        """ # check that bandwidth has same no. of elements as no. of features in X # only keep complete samples
None
self
X
a np.ndarray of floats of dimension 2
a np . ndarray of floats of dimension 2
y
a np.ndarray of floats with the same number of elements as the rows of X
a np . ndarray of floats with the same number of elements as the rows of X