private List <ClassificationResult> QueryPrediction(Dictionary <string, object> classifyData)
        {
            var                         apiKey                = BpmonlineCloudEngine.GetAPIKey(_userConnection);
            var                         serviceUrlArg         = new ConstructorArgument("serviceUrl", ServiceUrl);
            var                         apiKeyArg             = new ConstructorArgument("apiKey", apiKey);
            IMLServiceProxy             proxy                 = ClassFactory.Get <IMLServiceProxy>(serviceUrlArg, apiKeyArg);
            List <ClassificationResult> classificationResults = null;

            try {
                classificationResults = proxy.Classify(ModelInstanceUId, classifyData);
            } catch (Exception e) {
                _log.ErrorFormat("Classification failed with error: {0}", e, e.Message);
            }
            return(classificationResults);
        }
示例#2
0
 /// <summary>
 /// Predicts using the specified proxy.
 /// </summary>
 /// <param name="proxy">The proxy.</param>
 /// <param name="model">The model.</param>
 /// <param name="data">The input data.</param>
 /// <returns>
 /// Predicted result.
 /// </returns>
 protected override List <ClassificationResult> Predict(IMLServiceProxy proxy, MLModelConfig model,
                                                        Dictionary <string, object> data)
 {
     return(proxy.Classify(model.ModelInstanceUId, data));
 }