# Weka LibSVM one class classifier always predicts one class

I'm trying to use LibSVM classifier in Weka to build a one class SVM classifier.

My training file has list of noun words. My test file has many words. My aim is to use the classifier to predict the words which are nouns in test file.

My input arff file (ip.arff)(training file) looks like this:

@relation test1

@attribute name string
@attribute class {yes}

@data
'building',yes
'car',yes
..... and so on


My test file(test.arff) (test file) looks like this:

@relation test2

@attribute name string
@attribute class {yes}

@data
'car',?
'window',?
'running',?
..... and so on


Here's what I've done:

1. Since the datatype is string, I used batch Filtering on both input files to generate ipstd.arff and teststd.arff as mentioned in [http://weka.wikispaces.com/Batch+filtering][1]
2. Next i load and run the classifier with ipstd.arff. (Note: All the words are classified as yes)

3. Next I load the test set teststd.arff and re-evaluate the model.

4. But all the words are classified as nouns('yes')

=== Predictions on user test set ===

inst# actual predicted error prediction

  1        1:?      1:yes       1
2        1:?      1:yes       1
3        1:?      1:yes       1


and so on

My problem is that all words in test file(teststd.arff) are classified as nouns

Can someone tell where I'm going wrong.. What should I do classify noun words in test set with 'yes' and others as outliers. Thanks...

• Although phrased in terms of Weka, the problem here may be the logic the OP is using, not the code. This question may be better here than SO. – gung Dec 31 '14 at 21:54
• gung: supported. This is on-topic, even if it may need rewording. – kjetil b halvorsen Dec 31 '14 at 21:56
• i have some problem , how do you solved your probplem ? – tiendv Jan 9 '16 at 12:40