How to use the modelbase.ModelBase.BinLoss function in modelbase

To help you get started, we’ve selected a few modelbase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CalvinNeo / EasyMLPlatform / py / ml_models / model_task.py View on Github external
# possibles = globals()
        # possibles.update(locals())
        if (clsname.upper() in ModelBase.AllModelInfo().keys()): # and (clsname in possibles.keys()):
            # dataset.classfeatureindex is determined by mdinfo(and when training md.classfeatureindex is determined by dataset.classfeatureindex)
            ds['view'].classfeatureindex = mdinfo.classfeatureindex

            # need to set args to __init__
            # md = possibles.get(clsname)(dataset = ds['view'])
            # print ModelBase.AllModelInfo()[clsname.upper()]
            md = ModelBase.AllModelInfo()[clsname.upper()]['cls'](dataset = ds['view'])
            md.positive = mdinfo.positive
            md.negative = mdinfo.negative
            md.classfeatureindex = mdinfo.classfeatureindex
            md.loss = {
                'QUAD': ModelBase.QuadLoss
                ,'BIN': ModelBase.BinLoss
                ,'ABS': ModelBase.AbsLoss
                ,'LOG': ModelBase.LogLoss
            }[mdinfo.loss]

            self.dataset = ds['view']
            self.model = md