genetic-algorithm-feature-selection/modules/clade.py
def collapse(self):
        """
        want to remove clades with single descendants
        """
        if self._len_descs() == 1:
            if list(self.descs)[0]._len_descs() > 0:  # it is not an Individual
                desc = list(self.descs)[0]  # the descendant object
                self._descs = list(desc.descs)

        for desc in self.descs:
            desc.collapse()
            if desc._len_descs() == 1:
                self._descs = list(self.descs) + list(desc.descs)
                desc._descs = []

        want to remove clades with single descendants
        
want to remove clades with single descendants
want to remove clades with single descendants
def collapse(self):
        if self._len_descs() == 1:
            if list(self.descs)[0]._len_descs() > 0:  
                desc = list(self.descs)[0]  
                self._descs = list(desc.descs)
        for desc in self.descs:
            desc.collapse()
            if desc._len_descs() == 1:
                self._descs = list(self.descs) + list(desc.descs)
                desc._descs = []
def collapse ( self ) : if self . _len_descs ( ) == 1 : if list ( self . descs ) [ 0 ] . _len_descs ( ) > 0 : desc = list ( self . descs ) [ 0 ] self . _descs = list ( desc . descs ) for desc in self . descs : desc . collapse ( ) if desc . _len_descs ( ) == 1 : self . _descs = list ( self . descs ) + list ( desc . descs ) desc . _descs = [ ]
want to remove clades with single descendants
want to remove clades with single descendants
"""
        want to remove clades with single descendants
        """ # it is not an Individual # the descendant object
self