title: libsvm predict the same value for all testing data - c#
body: <p>I use the following example code to read training_file and testing_file. My data has three classes 0, 1, 2. The accuracy of my model is around 40%. All the output of prediction is 1. How to solve the problem? </p>
  
  <pre><code>var prob = ProblemHelper.ReadAndScaleProblem(TRAINING_FILE);
  var test = ProblemHelper.ReadAndScaleProblem(TEST_FILE);
  
  var svm = new C_SVC(prob, KernelHelper.RadialBasisFunctionKernel(gamma), C);
  var accuracy = svm.GetCrossValidationAccuracy(nr_fold);// with nr_fold &gt; 1
  for (int i = 0 ; i &lt; test.l ; i++){
      var x = test.x[i];
      var y = test.y[i];
      var predictedY = svm.Predict(x); // returns the predicted value for 'x' attributes
  }
  </code></pre>