示例#1
0
 def load(cls, model_desc: dict):
     obj_layout = cls()
     obj_layout.features = model_desc['features']
     obj_layout.formulas = decode(model_desc['formulas'])
     obj_layout.trained_time = model_desc['trained_time']
     obj_layout.impl = cls.model_decode(model_desc['desc'])
     if 'fit_target' in model_desc:
         obj_layout.fit_target = decode(model_desc['fit_target'])
     else:
         obj_layout.fit_target = None
     return obj_layout
示例#2
0
    def load(cls, universe_desc: dict):
        name = universe_desc['name']
        base_universe = universe_desc['base_universe']
        exclude_universe = universe_desc['exclude_universe']
        special_codes = universe_desc['special_codes']
        filter_cond = decode(universe_desc['filter_cond'])

        return cls(name=name,
                   base_universe=base_universe,
                   exclude_universe=exclude_universe,
                   special_codes=special_codes,
                   filter_cond=filter_cond)
示例#3
0
    def load(cls, model_desc: dict):
        obj_layout = cls()
        obj_layout.features = model_desc['features']
        obj_layout.trained_time = model_desc['trained_time']

        if LooseVersion(sklearn_version) < LooseVersion(model_desc['sklearn_version']):
            alpha_logger.warning('Current sklearn version {0} is lower than the model version {1}. '
                                 'Loaded model may work incorrectly.'.format(
                sklearn_version, model_desc['sklearn_version']))

        obj_layout.impl = decode(model_desc['desc'])
        return obj_layout
示例#4
0
def decode_formula(str_repr):
    formula = decode(str_repr)
    return formula
示例#5
0
 def model_decode(cls, model_desc):
     return decode(model_desc)