title: Spark ML Error: Incorrect no. of classes detected while using Linear SVC
body: <p>I am working on a binary classification problem and using SparkML, I trained and evaluated my data using Random Forest and Logistic Regression models and now I wanted to check how well SVM classifies my data. </p>
  
  <p><strong><em>Snippet of my training data</strong>:-</em> </p>
  
  <pre><code>+----------+------+
  |  spam    | count|
  +----------+------+
  |        No|197378|
  |       Yes|  7652|
  +----------+------+
  
  Note:- My dependent variable: 'spam': string (nullable = true)
  
  +-----+------+
  |label| count|
  +-----+------+
  |  0.0|197488|
  |  1.0|  7650|
  +-----+------+
  
  Note:- label: double (nullable = false)
  </code></pre>
  
  <p><em>Updates to my question</em>:-</p>
  
  <pre><code>trainingData.select('label').distinct().show()
  +-----+
  |label|
  +-----+
  |  0.0|
  |  1.0|
  +-----+
  </code></pre>
  
  <p>So, I used below code to fit my training data using <strong><em>Linear SVC</em></strong>:-<br></p>
  
  <pre><code> pyspark.ml.classification import LinearSVC
   lsvc = LinearSVC()
   # Fit the model
   lsvcModel = lsvc.fit(trainingData)
  </code></pre>
  
  <p>In my data frame, label and dependent variable have only 2 classes, but I get an error saying more classes are detected. Not really sure what's causing this exception.<br>
  Any help is much appreciated!</p>
  
  <p><strong><em>Error</strong>:-</em></p>
  
  <pre><code>IllegalArgumentException: u'requirement failed: LinearSVC only supports 
  binary classification. 3 classes detected in 
  LinearSVC_4240bb949b9fad486ec0__labelCol'
  </code></pre>