示例#1
0
        public ClassificationResult Test()
        {
            var result = new ClassificationResult("Test");

            foreach (var entry in dataSet.TestData)
            {
                var newX = SVMProblemBuilder.CreateNode(entry.stemmedClaim, dataSet.Vocabulary);
                var predictedSentiment = model.Predict(newX);
                var probability        = model.PredictProbabilities(newX);

                result.AddPrediction(entry.topicId, probability.Max(pair => pair.Value), entry.IsPredictionCorrect(predictedSentiment));
            }
            return(result);
        }
示例#2
0
 public SVMClassifier(DataSet dataSet, double c)
 {
     this.dataSet   = dataSet;
     this.c         = c;
     problemBuilder = new SVMProblemBuilder();
 }