title: One-class Classification
body: <p>I have more than 2500 samples on which static analysis has been performed, with more than 300 features extracted per sample. </p>
  
  <p>Among these samples, I have discriminated more than 10 <code>APT</code> class and my aim is to build, for each class, a one-class classifier.</p>
  
  <p>I'm using python scikit library for machine-learning, and in particular i'm facing with One-class SVM.</p>
  
  <p>First question:  There exist some other good one-class classifier for this approach?</p>
  
  <p>Second question: I have to come up with some metrics that can define a sort of "accuracy" of the classifier. Now I know that for one-class SVM the accuracy concept is not so well-define. I report my code and my concept:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  from sklearn import svm
  from sklearn.model_selection import train_test_split
  
  
  df = pd.read_csv('features_labeled_apt17.csv')
  
  X = df.ix[:,1:341].values
  
  
  
  X_train, X_test = train_test_split(X,test_size = 0.3,random_state = 42)
  
  
  
  clf = svm.OneClassSVM(nu=0.1,kernel = "linear", gamma =0.1)
  y_score = clf.fit(X_train)
  
  pred = clf.predict(X_test)
  
  
  print(pred)
  </code></pre>
  
  <p>These represents the output of the code:</p>
  
  <pre><code>[ 1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1 
  1  1   1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1 
  1  1 -1   1  1  1  1  1  1  1  1  1  1  1  1  1 -1  1  1  1  1  1  1  1  1  1 -1  1   1  1  1  1  1  1  1 -1  1  1  1  1  1  1  1  1 -1  1  1  1
  1 1  1  1  1   1  1  1  1  1 -1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  
  1  1  1  1  1   1  1  1  1  1  1]
  </code></pre>
  
  <p>The 1 represent of course the well-labeled sample, while the -1 represent the wrong one.</p>
  
  <p>First: do you think this can be a good approach?
  Second: For metrics, if I divide the total element in the testing set by the wrong labeled?</p>