weka

Principal Component Analysis on Weka

ⅰ亾dé卋堺 提交于 2019-12-04 10:01:15
I have just computed PCA on a training set and Weka returned me the new attributes with the way in which they were selected and computed. Now, I want to build a model using these data and then use the model on a test set. Do you know if there is a way to automatically modify the test set according to the new type of attributes? Do you need the principal components for analysis or just to feed into the classifier? If not just use the Meta->FilteredClassifier classifier. Set the filter to PrincipalComponents and and the classifier to whatever classifier you want to use. Train it on the un

Hadoop: Easy way to have object as output value without Writable interface

心已入冬 提交于 2019-12-04 08:53:07
I am trying to exploit hadoop to train multiple models . My data are small enough to fit in memory so i want to have one model trained in every map task. My problem is that when i have finished training my model, i need to send it to the reducer. I am using Weka to train the model. I don't want to start looking how to implement the Writable interface in Weka classes, because it needs a lot of effort. I am looking for a simple way to do this. The Classifier class in Weka implements the Serializable interface. How can i send this object to the reducer? edits Here is the link that mentions weka

How to apply classifier in Weka's Explorer?

你离开我真会死。 提交于 2019-12-04 08:15:30
Let's say, I've build a model (e.g. J4.8 tree) and evaluated it with cross-validation. How can I use this model to classify new dataset ? I know, I can set a file with the data to classify with "Supplied test set" option, mark "Output predictions" in "More options" window and run classification again. It will produce nearly what I need, but it seems to be a very strange workflow. Also, it re-creates all the model, which can take unnecessary time. Is there more straightforward way to do classification with already built model? There are special class SerializedClassifier in misc package, it

Test a single instance in Weka

被刻印的时光 ゝ 提交于 2019-12-04 06:23:57
问题 Does weka require the test instances to have the class attribute. I have used a training set arff file to train the classifier. Now I want to test an instance (not from arff file, have to create by code) without the class attribute and predict the class. I found this link Weka: How do I get the prediction value in java for a test instance? But my class attribute is a string 'Y' or 'N'. If evaluateModelOnce() returns double, what does it mean. Is it the class attribute or something else. i am

Train and test set are not compatible error in weka?

孤街浪徒 提交于 2019-12-04 03:47:43
I'm trying to test my model with new dataset. I have done the same preprocessing step as i have done for building my model. I have compared two files but there is no issues. I have all the attributes(train vs test dataset) in same order, same attribute names and data types. But still i'm not able to resolve the issue. Both of the files train and test seems to be similar but the weka explorer is giving me error saying Train and test set are not compatible. How to resolve this error? Is there any way to make test.arff file format as train.arff? Please somebody help me. The same with the comment

Weka only changing numeric to nominal

假如想象 提交于 2019-12-04 02:58:13
I have a CSV file that I am importing into Weka. All variables are importing as numeric. I need to change 3 of them to nominal. However when I place numerictonominal filter on it- all variables change. I only want to change 3. 1) Is there a way to just change a few via the filter 2) Or can you set it during the import. If so, I can't figure that out either. I assume you are using the Weka Explorer (GUI). To apply the filter to specific attributes do the following. Step 1: Select your filter in the preprocess tab Step 2: Click on the box to the right of the "Choose" button (a new window opens)

Load a file in Resources with FileInputStream

自古美人都是妖i 提交于 2019-12-04 01:54:54
I know the safe way to open a file in the resources is: InputStream is = this.getClass().getResourceAsStream("/path/in/jar/file.name"); now the problem is that my file is a model for a decider in the Weka Wrapper package and the Decider class has only a method: public void load(File file) throws Exception load takes the file and opens it as a FileInputStream. Do you see a workaround? I really would like to ship the model putting it in the resources. I was thinking to create a temporary file, write the content of the model in the temp file and then pass the temporary file to Weka, but it is so

beginner question on investigating on samples in Weka

本秂侑毒 提交于 2019-12-03 22:33:08
I've just used Weka to train my SVM classifier under "Classify" tag. Now I want to further investigate which data samples are mis-classified,I need to study their pattern,but I don't know where to look at this from Weka. Could anyone give me some help please? Thanks in advance. You can enable the option from: You will get the following instance predictions: === Predictions on test split === inst# actual predicted error prediction 1 2:Iris-ver 2:Iris-ver 0.667 ... 16 3:Iris-vir 2:Iris-ver + 0.667 EDIT As I explained in the comments, you can use the StratifiedRemoveFolds filter to manually split

Where should I save my file in Android for local access?

风流意气都作罢 提交于 2019-12-03 21:51:33
I have two datasets which are currently in the same folder as my java files AND on my PC. Currently, I am accessing them through my C-drive. Since this is an app, where should I save my .ARFF files and what path should I use instead? I have tried in the raw folder, but nothing seems to work. Here's what I have so far... Create a raw directory in your project, raw is included in the res folder of android project. You can add an assets files in raw folder like music files, database files or text files or some other files which you need to access directly 1) Right click on res folder, select New>

Could not find or load main class when calling Weka

拟墨画扇 提交于 2019-12-03 21:51:26
问题 I apologise for my Java noobness but I am trying to use Weka from console and for some reason I get following error: Error: Could not find or load main class weka.classifiers.trees.J48 I am trying following command: java weka.classifiers.trees.J48 -l C:\xampp\htdocs\frequencyreplyallwords.arff -T C:\xampp\htdocs\testfreqrep.arff -p 0 > C:\xampp\htdocs\output.txt I suspect some problems with classpath but since I don't really understand Java is there any simple way of checking if everything is