weka

weka stringToWordVector filter stringOptions

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to filter a dataset using weka's java API. I've successfully filtered the attributes I want with a stringToWordVector filter in Weka's GUI but I can't seem to do the same in my java code. I copied and pasted the auto-generated filtering parameters and posted them into my code but am continuing to get errors. Currently, my code looks like this: Instances newInsts = new Instances(this.instances); StringToWordVector stringFilter = new StringToWordVector(); stringFilter.setOptions( weka.core.Utils.splitOptions("-R 1,2,3,4,8 -W 1000

Weka 3.8.1 can't link to mtj.jar, causing java.lang.ClassNotFoundException: no.uib.cipr.matrix.Matrix

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm processing the some data in weka, and I want to use weka API so that I can use my self-defined algorithms. However, when I just want to instantiate the LinearRegression class: LinearRegression myRegression = new LinearRegression() I got the same error as: This person got the same problem and he roll back to version 3.6.12 I checked my weka.jar and I can find mtj.jar is included, so I'm sure there must be somewhere linked inapproriately. Downgrade the API version is not the best option for me because I want to use new class

unary class text classification in weka?

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a training dataset (text) for a particular category (say Cancer). I want to train a SVM classifier for this class in weka. But when i try to do this by creating a folder 'cancer' and putting all those training files to that folder and when i run to code i get the following error: weka.classifiers.functions.SMO: Cannot handle unary class! what I want to do is if the classifier finds a document related to 'cancer' it says the class name correctly and once i fed a non cancer document it should say something like 'unknown'. What

How to interpret weka classification?

巧了我就是萌 提交于 2019-12-03 01:50:51
问题 How can we interpret the classification result in weka using naive bayes? How is mean, std deviation, weight sum and precision calculated? How is kappa statistic, mean absolute error, root mean squared error etc calculated? What is the interpretation of the confusion matrix? 回答1: Below is some sample output for a naive Bayes classifier, using 10-fold cross-validation. There's a lot of information there, and what you should focus on depends on your application. I'll explain some of the results

Randomforest classification weka

匿名 (未验证) 提交于 2019-12-03 01:46:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The attributes have been saved in 11 columns in csv file. If the order of columns change, Do Randomforest & RandomTree could give different accuracy in each time? 回答1: Ordering of the features does not affect any of classifiers I know (except those which are specially designed to do so - like specialistic classifiers for time series and other temporal features), no matter if it is Neural Network, SVM, RandomForest, RandomTree or NaiveBayes - it is just a numerical simplification, as arrays are faster then sets, while "under the hood" they

How to use LibSVM with Weka in my Java code?

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to use LibSVM classifier with Weka in my application. How can I (or where can I find good examples to) do this? 回答1: A little late now, surely, but I'll answer anyways. You have to use weka.jar, libsvm.jar, and wlsvm.jar (the libsvm wrapper) in your project. So just include all 3 jars in your build path or class path or whatever. You can get the wlsvm.jar from here: http://www.cs.iastate.edu/~yasser/wlsvm/ You can get weka from here: http://www.cs.waikato.ac.nz/ml/weka/ And you can get libsvm from here: http://www.csie.ntu.edu.tw/

Weka UI and API code in Java gives different results

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am new to Weka. I am trying to run WEKA using API's and have found out that the results from the WEKA GUI does not match to the one produced by the Java code. I am trying to run a RandomForest Algorithm by providing TrainingSet and Test Set. Here is the code snippet: DataSource ds = new DataSource(trainingFile); Instances insts = ds.getDataSet(); insts.setClassIndex(insts.numAttributes() - 1); Classifier cl = new RandomForest(); RandomForest rf = (RandomForest)cl; // rf.setOptions(options); // rf.setNumExecutionSlots(1); rf.setNumFeatures

Java, Weka: NaiveBayesUpdateable: Cannot handle numeric class

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use NaiveBayesUpdateable classifier from Weka. My data contains both nominal and numeric attributes: @relation cars @attribute country {FR, UK, ...} @attribute city {London, Paris, ...} @attribute car_make {Toyota, BMW, ...} @attribute price numeric %% car price @attribute sales numeric %% number of cars sold I need to predict the number of sales (numeric!) based on other attributes. When I run: // Train classifier ArffLoader loader = new ArffLoader(); loader.setFile(new File(trainFileName)); Instances structure = loader

How to add LibSVM class to WEKA classpath on a Mac

∥☆過路亽.° 提交于 2019-12-02 20:50:18
I am running Max OS X 10.7 Lion and I want to use WEKA with LibSVM from command line. I get this error: Problem evaluating classifier: libsvm classes not in CLASSPATH! I found the LibSVM library here . I need to add it to my Java classpath so that WEKA can find it. The download contains several files, shown below. I don't know how to add them to my classpath for Java. I am attempting to use the LibSVM classifier in WEKA because it is preferable for me over SMO. I am also unsure if this means the Java classpath or if it is specific to WEKA. I also don't know where to get these classes from. Any

Same Instances header ( arff ) for all my database queries

自古美人都是妖i 提交于 2019-12-02 18:58:23
问题 I am using InstanceQuery , SQL queries, to construct my Instances. But my query results does not come in the same order always as it is normal in SQL. Beacuse of this Instances constucted from different SQL has different headers. A simple example can be seen below. I suspect my results changes because of this behavior. Header 1 @attribute duration numeric @attribute protocol_type {tcp,udp} @attribute service {http,domain_u} @attribute flag {SF} Header 2 @attribute duration numeric @attribute