title: Check if my data are linearly separable
body: <p>This post is followed by the post below:</p>
  
  <p><a href="https://cs.stackexchange.com/questions/70395/what-is-the-effect-of-hidden-layer-size">https://cs.stackexchange.com/questions/70395/what-is-the-effect-of-hidden-layer-size</a></p>
  
  <p>I would like to find out whether my data is linearly separable or not. Following the comment I received in the post linked above, I decided to run a hard-SVM on my data to see the classification results.</p>
  
  <p>My input data, X is a matrix of (10000, 128) and the output/target/classes are (10000, 10). I have 10 classes ranges from 1 to 10.</p>
  
  <p>using following code, I tried LogisticRegression(), svm.LinearSVC(C=1, loss='hinge'), and svm.SVC(kernel='linear', C=1):</p>
  
  <pre><code>dataframe = read_csv('data.txt')
  array = dataframe.values
  
  X = array[:, 0:128]
  y = array[:,-1]
  
  plt.hist(y, bins='auto')  # plt.hist passes it's arguments to np.histogram
  plt.title("Histogram with 'auto' bins")
  plt.show()
  
  models = []
  models.append(('LR', LogisticRegression() ))
  models.append(('LSVM', svm.LinearSVC(C=1, loss='hinge') ))
  models.append(('LSVM2', svm.SVC(kernel='linear', C=1) ))
  
  results=[]
  names=[]
  scoring = 'accuracy'
  for name, model in models:
      kfold = KFold(n_splits=10, random_state=7)
      cv_results = cross_val_score(model, X, y, cv=kfold, scoring=scoring)
      results.append(cv_results)
      names.append(name)
      msg = "%s: %f (%f)" % (name, cv_results.mean(), cv_results.std())
      print(msg)
  </code></pre>
  
  <p>and here are the results:</p>
  
  <pre><code>LR: 0.613360 (0.019632)
  LSVM: 0.307829 (0.020123)
  LSVM2: 1.000000 (0.000000)
  </code></pre>
  
  <p>I have 2 questions:</p>
  
  <p>(1) is my data linearly separable?</p>
  
  <p>(2) is the results of LSVM2 strange? 
  for this I further used </p>
  
  <pre><code>models.append(('RBFSVM', svm.SVC(kernel='rbf', gamma=0.7, C=1) ))
  models.append(('POLYSVM', svm.SVC(kernel='poly', degree=3, C=1) ))
  </code></pre>
  
  <p>and received the following:</p>
  
  <pre><code>RBFSVM: 0.797680(.015187)
  POLYSVM: 0.100011(0.008113)
  </code></pre>
  
  <p>can you please help me get more intuition?</p>
  
  <p>Thanks,</p>