/// <summary>
        /// Scores value for the specified model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="dataForPrediction">The data for prediction.</param>
        /// <param name="proxy">The proxy.</param>
        /// <returns>
        /// Numeric value result.
        /// </returns>
        protected override List <double> Predict(MLModelConfig model,
                                                 IList <Dictionary <string, object> > dataForPrediction, IMLServiceProxy proxy)
        {
            List <ScoringOutput> predictionResults = proxy.Score(model, dataForPrediction, false);
            List <double>        scores            = predictionResults.Select(output => output.Score).ToList();

            return(scores);
        }
示例#2
0
 /// <summary>
 /// Predicts results for the given batch of records.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="dataList">Batch of records.</param>
 /// <param name="proxy">ML service proxy.</param>
 /// <returns>Prediction result.</returns>
 protected override List <ScoringOutput> Predict(MLModelConfig model,
                                                 IList <Dictionary <string, object> > dataList, IMLServiceProxy proxy)
 {
     return(proxy.Score(model, dataList, true));
 }
示例#3
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 ScoringOutput Predict(IMLServiceProxy proxy, MLModelConfig model,
                                          Dictionary <string, object> data)
 {
     return(proxy.Score(model, data, true));
 }