Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@celeryApp.task(ignore_result=True, after_return=process_task_result)
def count_actuals_by_prediction_id_task(params):
return ModelReview(params).count_actuals_by_prediction_id()
@celeryApp.task(ignore_result=True, after_return=process_task_result)
def score_actuals_by_model_task(params):
return ModelReview(params).score_actuals(
actuals_path = params.get('actuals_path'),
actual_records=params.get('actual_records'),
prediction_group_id=params.get('prediction_group_id', None),
primary_prediction_group_id=params.get('primary_prediction_group_id', None),
primary_model_path=ModelHelper.get_model_path(params.get('primary_pipeline_id', None),
params.get('hub_info', {}).get('projectPath')),
actual_date=params.get('actual_date'),
actuals_id=params.get('actuals_id')
)
@celeryApp.task(after_return=__handle_task_result)
def predict_model_task(params):
def _predict(ctx):
return A2MLModel(ctx).predict(*params['args'], **params['kwargs'])
return with_context(params, _predict)
@celeryApp.task
def remove_tmp_file(path):
fsclient.remove_file(path)
@celeryApp.task(after_return=__handle_task_result)
def deploy_task(params):
return with_context(
params,
lambda ctx: A2ML(ctx).deploy(*params['args'], **params['kwargs'])
)
@celeryApp.task(after_return=__handle_task_result)
def evaluate_task(params):
return with_context(
params,
lambda ctx: A2ML(ctx).evaluate(*params['args'], **params['kwargs'])
)
@celeryApp.task(after_return=__handle_task_result)
def list_datasets_task(params):
def func(ctx):
res = A2MLDataset(ctx, None).list(*params['args'], **params['kwargs'])
return __map_collection_to_name(res, 'datasets')
return with_context(params, func)
@celeryApp.task(after_return=__handle_task_result)
def select_project_task(params):
return with_context(
params,
lambda ctx: A2MLProject(ctx, None).select(*params['args'], **params['kwargs'])
)
@celeryApp.task(ignore_result=True, after_return=process_task_result)
def remove_model_task(params):
return ModelReview(params).remove_model()
@celeryApp.task(ignore_result=True, after_return=process_task_result)
def distribution_chart_stats_task(params):
return ModelReview(params).distribution_chart_stats(
date_from=params.get('date_from'),
date_to=params.get('date_to')
)