You need to use FilteredClassifier for this purpose. The code snippet is.
You need to use FilteredClassifier for this purpose. The code snippet is : StringToWordVector strWVector = new StringToWordVector(); filteredClassifier fcls = new FilteredClassifier(); fcls. SetFilter(strWVector); fcls.
SetClassifier(new SMO()); fcls. BuildClassifier(yourdata) //rest of your code This is much easier as you can pass your instances all at once. FilteredClassifier takes care of all other details.
The code is not tested but it will get you started. Edit : You can do in the following way too. This is code snippet from weka tutorial See http://weka.wikispaces.com/Use+WEKA+in+your+Java+code#Filter-Filtering%20on-the-fly Batch Mode for details Instances train = ... // from somewhere Instances test = ... // from somewhere Standardize filter = new Standardize(); filter.
SetInputFormat(train); // initializing the filter once with training set Instances newTrain = Filter. UseFilter(train, filter); // configures the Filter based on train instances and returns filtered instances Instances newTest = Filter. UseFilter(test, filter); // create new test se HTH.
Thanks for the input. I don't think this is what I am after. We have a pre-exisitng classifier which we want to load up, I tried doing this and using the FilteredClassifer's set method, but it complains about no output format set.
I'm guessing it wants the training data as an input... However there seems to be no interface to do this with StringToWordVector – NightWolf Sep 2 at 8:41 see the edits..instead applying filter to each instance it applies a filter in a batch mode.. – iinception Sep 3 at 2:50.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.