title: Does Opencv 3 SVM trainAuto scale labels too?
body: <p>I'm using OpenCV 3.0.0. When running OpenCV's SVM example <a href="http://docs.opencv.org/3.0-beta/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.html" rel="nofollow noreferrer">1</a> I noticed that when auto trained instead of trained, the predicted values are between 0 and 1. I don't see the same behavior when I run the same example directly with libsvm.</p>
  
  <p>Is this a bug or an intentional scaling of the labels along with the other features? The behavior also seems to be undocumented.</p>
  
  <p>Here is the code I'm running:</p>
  
  <pre><code>    // Set up training data
  size_t numberOfSamples = 4;
  cv::Mat1i labelsMat(numberOfSamples, 1);
  labelsMat(0, 0) = 1;
  labelsMat(1, 0) = -1;
  labelsMat(2, 0) = -1;
  labelsMat(3, 0) = -1;
  
  cv::Mat1f trainingDataMat(numberOfSamples, 2);
  // Sample 0
  trainingDataMat(0, 0) = 501;
  trainingDataMat(0, 1) = 10;
  
  // Sample 1
  trainingDataMat(1, 0) = 255;
  trainingDataMat(1, 1) = 10;
  
  // Sample 2
  trainingDataMat(2, 0) = 501;
  trainingDataMat(2, 1) = 255;
  
  // Sample 3
  trainingDataMat(3, 0) = 10;
  trainingDataMat(3, 1) = 501;
  
  // Set up SVM's parameters
  cv::Ptr&lt;cv::ml::SVM&gt; svm = cv::ml::SVM::create();
  svm-&gt;setType(cv::ml::SVM::C_SVC);
  svm-&gt;setKernel(cv::ml::SVM::LINEAR);
  svm-&gt;setTermCriteria(cv::TermCriteria(cv::TermCriteria::MAX_ITER, 100, 1e-6));
  
  // Train the SVM with given parameters
  cv::Ptr&lt;cv::ml::TrainData&gt; td =
      cv::ml::TrainData::create(trainingDataMat, cv::ml::ROW_SAMPLE, labelsMat);
  
  // train the SVM
  // svm-&gt;train(td);
  
  // or auto train
  svm-&gt;trainAuto(td);
  
  // predict
  // first point used for training
  cv::Mat point1 = (cv::Mat_&lt;float&gt;(1, 2) &lt;&lt; 501, 10);
  float response1 = svm-&gt;predict(point1); 
  // second point used for training
  cv::Mat point2 = (cv::Mat_&lt;float&gt;(1, 2) &lt;&lt; 255, 10);
  float response2 = svm-&gt;predict(point2);
  
  std::cout &lt;&lt; "first point: " &lt;&lt; response1 &lt;&lt; "\n" &lt;&lt;
            &lt;&lt; "second point: " &lt;&lt; response2 &lt;&lt; std::endl;
  </code></pre>
  
  <p>If ran with trainAuto it will output 0 and 1 instead of -1 and 1.</p>