Esempio n. 1
0
def som(parameters):
    if parameters.get('model_id'):
        model_id = parameters.get('model_id')
    else:
        model_id = secrets.token_urlsafe(16)
    try:
        model_helper.model_create(model_id, "som", parameters)
    except Exception as err:
        config.logger.error(str(err))
        err_message = result.ErrorResult()
        return err_message()
    else:
        success_message = result.SuccessResult()
        success_message.add("model_id", model_id)
        return success_message()
Esempio n. 2
0
def random_forest_classifier(parameters):
    if parameters.get('model_id'):
        model_id = parameters.get('model_id')
    else:
        model_id = secrets.token_urlsafe(16)
    try:
        model_helper.model_create(model_id, "random_forest_classifier".lower(), parameters)
    except Exception as err:
        config.logger.error(str(err))
        config.logger.error(traceback.print_exc())
        err_message = result.ErrorResult()
        return err_message()
    else:
        success_message = result.SuccessResult()
        success_message.add("model_id", model_id)
        return success_message()