One class SVM using python, not able to interpret the results on the graph
<p>I am using One class SVM on a two featured data set whose features are time in seconds and day in number (eg: 0 for Monday, 6 for Sunday). I divided my data into two parts and trained the model with one partition. The other, I am using as test data to get the results. </p>

<p>After applying predict function, I am getting 1 and -1 for the data. I am comparing this list of results with the test data and finding out the outlying data. After plotting the outlier data, I found that all the outliers are concentrated in the same region. This does not make sense to my use case. </p>

<p>I am guessing the problem is with comparison of predict results with the test data. If so, please suggest me a way to retrieve such data that is giving -1 as the value. </p>

<pre><code>clf = svm.OneClassSVM(nu=0.1, kernel="linear", gamma=0.1)
clf.fit(y_train)
y_pred_train = clf.predict(y_test)
for data,value in zip(y_test,y_pred_train):
if value == -1:
    outl += 1
    outliers_data.append(data)
elif value == 1:
    inl += 1
    inliers_data.append(data)



xx, yy = np.meshgrid(np.linspace(-5, 5, 1), np.linspace(-5, 5, 7500))
Z = clf.decision_function(np.c_[xx.ravel(),yy.ravel()])
Z = Z.reshape(xx.shape)
plt.contourf(xx, yy,  Z, levels=np.linspace(Z.min(), 0, 7), cmap=plt.cm.Blues_r)
b1 = plt.scatter(y_test[:, 0], y_test[:, 1],  c='red')
b3 = plt.scatter(in_liers[:,0], in_liers[:, 1], c="green")
plt.legend([a.collections[0],b1,b3],
       ["learned frontier", "test","outliers"],
       loc="lower right",
       prop=matplotlib.font_manager.FontProperties(size=11))
</code></pre>

<p>Also please suggest if I have to change the kernel type to rbf or anything else.</p>