(self)
Return a short name derived from Learner type name
Return a short name derived from Learner type name
Return a short name derived from Learner type name
def name(self):
        """Return a short name derived from Learner type name"""
        try:
            return self.__name
        except AttributeError:
            name = self.__class__.__name__
            if name.endswith('Learner'):
                name = name[:-len('Learner')]
            if name.endswith('Fitter'):
                name = name[:-len('Fitter')]
            if isinstance(self, SklLearner) and name.startswith('Skl'):
                name = name[len('Skl'):]
            name = name or 'learner'
            # From http://stackoverflow.com/a/1176023/1090455 <3
            self.name = re.sub(r'([a-z0-9])([A-Z])', r'\1 \2',
                               re.sub(r'(.)([A-Z][a-z]+)', r'\1 \2', name)).lower()
            return self.name
def name ( self ) : try : return self . __name except AttributeError : name = self . __class__ . __name__ if name . endswith ( 'Learner' ) : name = name [ : - len ( 'Learner' ) ] if name . endswith ( 'Fitter' ) : name = name [ : - len ( 'Fitter' ) ] if isinstance ( self , SklLearner ) and name . startswith ( 'Skl' ) : name = name [ len ( 'Skl' ) : ] name = name or 'learner' # From http://stackoverflow.com/a/1176023/1090455 <3 self . name = re . sub ( r'([a-z0-9])([A-Z])' , r'\1 \2' , re . sub ( r'(.)([A-Z][a-z]+)' , r'\1 \2' , name ) ) . lower ( ) return self . name