(self, x, y)
return scores.mean()
kNNEvaluate - evaluate class separation in the given projection using a k-NN method
        Parameters
        ----------
        x - variables to evaluate
        y - class

        Returns
        -------
        scores
kNNEvaluate - evaluate class separation in the given projection using a k-NN method
        Parameters
        ----------
        x - variables to evaluate
        y - class
kNNEvaluate - evaluate class separation in the given projection using a k - NN method Parameters ---------- x - variables to evaluate y - class
def _evaluate_projection(self, x, y):
        """
        kNNEvaluate - evaluate class separation in the given projection using a k-NN method
        Parameters
        ----------
        x - variables to evaluate
        y - class

        Returns
        -------
        scores
        """
        if self.percent_data_used != 100:
            rand = np.random.choice(len(x), int(len(x) * self.percent_data_used / 100),
                                    replace=False)
            x = x[rand]
            y = y[rand]
        neigh = KNeighborsClassifier(n_neighbors=3) if self.attr_color.is_discrete else \
            KNeighborsRegressor(n_neighbors=3)
        assert ~(np.isnan(x).any(axis=None) | np.isnan(x).any(axis=None))
        neigh.fit(x, y)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", category=UserWarning)
            scores = cross_val_score(neigh, x, y, cv=3)
        return scores.mean()
def _evaluate_projection ( self , x , y ) : if self . percent_data_used != 100 : rand = np . random . choice ( len ( x ) , int ( len ( x ) * self . percent_data_used / 100 ) , replace = False ) x = x [ rand ] y = y [ rand ] neigh = KNeighborsClassifier ( n_neighbors = 3 ) if self . attr_color . is_discrete else KNeighborsRegressor ( n_neighbors = 3 ) assert ~ ( np . isnan ( x ) . any ( axis = None ) | np . isnan ( x ) . any ( axis = None ) ) neigh . fit ( x , y ) with warnings . catch_warnings ( ) : warnings . simplefilter ( "ignore" , category = UserWarning ) scores = cross_val_score ( neigh , x , y , cv = 3 ) return scores . mean ( )