def POST(self, name):
global g_models<EOL>data = json.loads(web.data())<EOL>modelParams = data["<STR_LIT>"]<EOL>predictedFieldName = data["<STR_LIT>"]<EOL>if name in g_models.keys():<EOL><INDENT>raise web.badrequest("<STR_LIT>" % name)<EOL><DEDENT>model = ModelFactory.create(modelParams)<EOL>model.enableInference({'<STR_LIT>': predictedFieldName})<EOL>g_models[name] = model<EOL>return json.dumps({"<STR_LIT:success>": name})<EOL>
/models/{name}

schema:
{
  "modelParams": dict containing model parameters
  "predictedFieldName": str
}

returns:
{"success":name}