growingspheres/growingfields.py
def find_counterfactual(self):
        """
        Finds the decision border then perform projections to make the explanation sparse.
        """
        ennemies_, radius = self.exploration()
        ennemies_ = sorted(ennemies_, 
                                 key= lambda x: pairwise_distances(self.obs_to_interprete.reshape(1, -1), x.reshape(1, -1)))
        closest_ennemy_ = ennemies_[0]
        self.e_star = closest_ennemy_
        if self.sparse == True:
            out = self.feature_selection(closest_ennemy_)
        else:
            out = closest_ennemy_
        return out, ennemies_, radius

        Finds the decision border then perform projections to make the explanation sparse.
        
Finds the decision border then perform projections to make the explanation sparse.
Finds the decision border then perform projections to make the explanation sparse .
def find_counterfactual(self):
        ennemies_, radius = self.exploration()
        ennemies_ = sorted(ennemies_, 
                                 key= lambda x: pairwise_distances(self.obs_to_interprete.reshape(1, -1), x.reshape(1, -1)))
        closest_ennemy_ = ennemies_[0]
        self.e_star = closest_ennemy_
        if self.sparse == True:
            out = self.feature_selection(closest_ennemy_)
        else:
            out = closest_ennemy_
        return out, ennemies_, radius
def find_counterfactual ( self ) : ennemies_ , radius = self . exploration ( ) ennemies_ = sorted ( ennemies_ , key = lambda x : pairwise_distances ( self . obs_to_interprete . reshape ( 1 , - 1 ) , x . reshape ( 1 , - 1 ) ) ) closest_ennemy_ = ennemies_ [ 0 ] self . e_star = closest_ennemy_ if self . sparse == True : out = self . feature_selection ( closest_ennemy_ ) else : out = closest_ennemy_ return out , ennemies_ , radius
Finds the decision border then perform projections to make the explanation sparse.
Finds the decision border then perform projections to make the explanation sparse .
"""
        Finds the decision border then perform projections to make the explanation sparse.
        """
self