__init__.py 577 B

1234567891011121314151617181920212223242526
  1. # -*- coding:utf-8 -*-
  2. """
  3. @author: yq
  4. @time: 2023/12/28
  5. @desc: 模型相关
  6. """
  7. from commom import GeneralException
  8. from enums import ModelEnum, ResultCodesEnum
  9. from .model_base import ModelBase
  10. from .model_lr import ModelLr
  11. __all__ = ['ModelBase', 'f_get_model']
  12. model_map = {
  13. ModelEnum.LR.value: ModelLr
  14. }
  15. def f_get_model(model_type: str):
  16. if model_type not in model_map.keys():
  17. raise GeneralException(ResultCodesEnum.ILLEGAL_PARAMS, message=f"模型【{model_type}】没有实现")
  18. return model_map[model_type]
  19. if __name__ == "__main__":
  20. pass