def train(request, perm, disabled4reader):
    action = request.POST.get('action')
    rid = request.POST.get('hf_w_id')
    if action is None or not action in ("mllib_api", "scikit_api"):
        return Response({"error": "not supported."}, status=404)
    if rid is None:
        return Response({"error": "id not found"}, status=404)
    # check doc
    document = _list.get_ds_doc(rid, perm)
    #print "document..=",document
    if document is None:
        return Response({"error": "dataset not found"}, status=404)

    rid, msg_id, ret_msg = _list.ml_opts(request, perm, disabled4reader)
    ret = {"id": rid, "msg_id": msg_id, "ret_msg": ret_msg}
    return Response(ret)
Exemplo n.º 2
0
def ml_opts(request):
    print 'at ml_opts()'
    uname, grp, perm, disabled4reader = get_perm(request)
    return _list.ml_opts(request, perm, disabled4reader)