weka

Errors when converting CSV to ARFF in Android using Weka

南笙酒味 提交于 2019-12-24 11:46:51
问题 I'm sing the code and instructions found on the weka site https://weka.wikispaces.com/Converting+CSV+to+ARFF But for some reason its giving me errors. Notice I check to make sure the file exists and is readable. Code for CSVLoader.java https://github.com/rjmarsan/Weka-for-Android/blob/925a77b566d6e55a775911fbf317234d11ec8024/src/weka/core/converters/CSVLoader.java Android Code String input = Environment.getExternalStorageDirectory().getAbsolutePath()+"/homework1/user_patterns.csv"; String

How to Normalize word frequencies of document in Weka

限于喜欢 提交于 2019-12-24 09:17:22
问题 In Weka, class StringToWordVector defines a method called setNormalizeDocLength . It normalizes word frequencies of a document. My questions are: what is meant by "normalizing word frequency of a document"? How Weka does this? A practical example will help me best. Thanks in advance. 回答1: Looking in the Weka source, this is the method that does the normalising: private void normalizeInstance(Instance inst, int firstCopy) throws Exception { double docLength = 0; if (m_AvgDocLength < 0) { throw

Graphviz and Weka only generates empty trees

落爺英雄遲暮 提交于 2019-12-24 07:58:40
问题 I downloaded Graphviz and installed their package for Weka 3.9, created the props file as indicated on https://github.com/fracpete/graphviz-treevisualize-weka-package with content: Executable="C:\Program Files (x86)\Graphviz2.38\bin\dot.exe" (Tried with and without quotation marks) And it will only generate empty trees through plugin->visualize tree (Graphviz). I'm in a bit of stress because I need to deliver a project by this night and discovered an error last moment, can anyone please help?

Results from each fold in 10-fold Cross Validation in WEKA, using command-line.

混江龙づ霸主 提交于 2019-12-24 07:17:16
问题 This question is similar to this one: Weka: Results of each fold in 10-fold CV but I am instead looking to get the same results from the command-line. Hence, if this is my input java -cp "./weka.jar" weka.classifiers.trees.J48 -t ./WEKA_reference_test_set.arff -x 10 -i > test.csv How can I specify my output so that I can see the results for each fold? Thanks. 来源: https://stackoverflow.com/questions/21419588/results-from-each-fold-in-10-fold-cross-validation-in-weka-using-command-line

How to use created model with new data in Weka

烈酒焚心 提交于 2019-12-24 05:54:47
问题 I'm trying some tests on weka, hope someone can help me and i can made myself clear. Step 1: Tokenize my data @attribute text string @attribute @@class@@ {derrota,empate,win} @data 'O Grêmio perdeu para o Cruzeiro por 1 a 0',derrota 'O Grêmio venceu o Palmeiras em um grande jogo de futebol, nesta quarta-feira na Arena',vitoria Step 2: Build model on tokenized data After loading this i apply a StringToWordVector. After applying this filter i save a new arff file with the words tokenized.

Get risk predictions in WEKA using own Java code

拟墨画扇 提交于 2019-12-24 04:24:05
问题 I already checked the "Making predictions" documentation of WEKA and it contains explicit instructions for command line and GUI predictions. I want to know how to get a prediction value like the one below I got from the GUI using the Agrawal dataset ( weka.datagenerators.classifiers.classification.Agrawal ) in my own Java code: inst#, actual, predicted, error, prediction 1, 1:0, 2:1, +, 0.941 2, 1:0, 1:0, , 1 3, 1:0, 1:0, , 1 4, 1:0, 1:0, , 1 5, 1:0, 1:0, , 1 6, 1:0, 1:0, , 1 7, 1:0, 2:1, +,

eclipse error: says build path is incomplete

南楼画角 提交于 2019-12-24 03:33:45
问题 Description : Type The project was not built since its build path is incomplete. Cannot find the class file for weka.core.Instance. Fix the build path then try building this project. It is not an android code, also do I need to post some code too. I think code is irrelevant for this error Tried this solution: Right click on project -> Properties -> Java Build Path (From Left List) -> Libraries (Tab) -> Add Library (Button on right) -> JRE System Library -> Next -> Workspace default JRE ->

how to impose syntactic constraints in apriori in weka

﹥>﹥吖頭↗ 提交于 2019-12-24 00:39:40
问题 there is a way to insert syntactic constraints in weka algorithm priori? For example, I be interested only in rules that have a specific item I(x) appearing in the consequent, or rules that have a specific item I(y) appearing in the antecedent, or combinations of the above constraints. 回答1: You can mine rules with a specific item "I" (what I(x) means in your notation?) appearing in the consequent. For this you need to set the corresponding column "I" as "class variable", that is to make it

Weka predictions to CSV from command line

烈酒焚心 提交于 2019-12-24 00:35:11
问题 This is similar to this question: Weka Predictions to CSV, but from the command line. I have the following Weka command: java -Xmx10G weka.classifiers.meta.FilteredClassifier \ -t test_data.arff -d prediction.model -p first -no-cv \ -F "weka.filters.unsupervised.attribute.Remove -R 1" \ -W hr.irb.fastRandomForest.FastRandomForest \ -- -I 512 -K 0 -S 512 Which gives me the following data: === Predictions on training data === inst# actual predicted error prediction (primary_key) 1 1:0 1:0 0.996

Export weka results on command line

主宰稳场 提交于 2019-12-23 22:32:34
问题 Is it possible to export weka results after execute it via command line? What I am doing: java -cp "./weka.jar" weka.classifiers.bayes.NaiveBayes -t "iris.arff" -i But then, I have all the statistics in console, is there any way to export this? Or I have to read and write by myself? Thanks! 回答1: An example from the Weka Primer: java -Xmx1024m weka.classifiers.trees.J48 -t data.arff -i -k -d J48-data.model >&! J48-data.out & So no, WEKA doesn't have a specific output parameter on the command