Exemple #1
0
        public double[] GetLikelihoods(double[] instance_features)
        {
            svm_node[] testnode = TemplateModelLibSVMCSVC.CreateNodeArray(instance_features);

            //This works correctly:
            Dictionary <int, double> prediction = svm.PredictProbabilities(testnode);

            int[] labels = prediction.Keys.ToArray();
            return(ToolsCollection.GetValueArray(prediction, labels));
        }
Exemple #2
0
 public override int GetLabel(double[] instance_features)
 {
     svm_node[] testnode = TemplateModelLibSVMCSVC.CreateNodeArray(instance_features);
     return((int)svm.Predict(testnode));
 }