(self, X)
return self
Train model based on input data.

        Parameters
        ----------
        X : array-like, shape = [n_minority_samples, n_features]
            Holds the minority samples.
Train model based on input data.
Train model based on input data .
def fit(self, X):
        """Train model based on input data.

        Parameters
        ----------
        X : array-like, shape = [n_minority_samples, n_features]
            Holds the minority samples.
        """
        self.X = X
        self.n_minority_samples, self.n_features = self.X.shape

        # Learn nearest neighbors.
        self.neigh = NearestNeighbors(n_neighbors=self.k + 1)
        self.neigh.fit(self.X)

        return self
def fit ( self , X ) : self . X = X self . n_minority_samples , self . n_features = self . X . shape # Learn nearest neighbors. self . neigh = NearestNeighbors ( n_neighbors = self . k + 1 ) self . neigh . fit ( self . X ) return self