weka

Can't run Weka explorer on Ubuntu 14.04

梦想的初衷 提交于 2019-12-12 13:01:56
问题 I've read that there are only two steps needed to run Weka on linux, that is: Add weka directory to CLASSPATH Run java -jar weka.jar After running above command I'm getting: Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207) at java.awt.Window.<init>(Window.java:535) at java.awt.Frame.<init>(Frame.java:420) at javax.swing.JFrame.<init>(JFrame.java:218) at weka.gui

Why WEKA Evaluation class need train instances?

冷暖自知 提交于 2019-12-12 10:35:25
问题 I do not understand why Weka Evaluation class constructor needs the train instances to work. can anybody explain me? In theory, the evaluation depends only of the trained model ( cls in the next code) and test data ( TestingSet ). Thanks! This is an example: // TrainingSet is the training Instances // TestingSet is the testingInstances // Build de classifier Classifier cls = (Classifier) new NaiveBayes(); cls.buildClassifier(TrainingSet); // Test the model Evaluation eTest = new Evaluation(*

Cannot handle any class attribute! kmeans java

跟風遠走 提交于 2019-12-12 10:24:41
问题 I want execute a k-means algorithm i use for this weka in eclipse i have this code public class demo { public demo() throws Exception { // TODO Auto-generated constructor stub BufferedReader breader = null; breader = new BufferedReader(new FileReader( "D:/logiciels/weka-3-7-12/weka-3-7-12/data/iris.arff")); Instances Train = new Instances(breader); Train.setClassIndex(Train.numAttributes() - 1); SimpleKMeans kMeans = new SimpleKMeans(); kMeans.setSeed(10); kMeans.setPreserveInstancesOrder

How to create an ARFF file from an array in java?

怎甘沉沦 提交于 2019-12-12 09:20:54
问题 I want to get the coefficients of a weighted linear regression of an x-y pair represented by two arrays in java. I have zeroed in on weka, but it is asking an 'Instances' class object in the 'LinearRegression' class. To create an 'Instances' class file, an ARFF file is needed which contains the data. I have come across solutions that use the FastVector class but that has now been deprecated in the latest weka version. How do I create an ARFF file for the x-y pair and the corresponding weights

How to build a good training data set for machine learning and predictions?

倖福魔咒の 提交于 2019-12-12 09:01:28
问题 I have a school project to make a program that uses the Weka tools to make predictions on football (soccer) games. Since the algorithms are already there (the J48 algorithm), I need just the data. I found a website that offers football game data for free and I tried it in Weka but the predictions were pretty bad so I assume my data is not structured properly. I need to extract the data from my source and format it another way in order to make new attributes and classes for my model. Does

WEKA software analysis of confusion matrix

穿精又带淫゛_ 提交于 2019-12-12 07:01:58
问题 *Hi again i am in problem for comparing confusion matrix. Bellow i have provided the two confusion matrix. a b classified as 349 58 a tested_negative 93 124 b tested_positive a b classified as 346 61 a tested_negative 90 127 b tested_positive i know that the diagonal of top-left to right but here both that value is same so how can i make decision which one best?* 回答1: It actually depends on your specific application. Say you want to minimize number of false positives (because it will cost you

Weka output predictions

落花浮王杯 提交于 2019-12-12 06:36:55
问题 I've used the Weka GUI for training and testing a file (making predictions), but can't do the same with the API. The error I'm getting says there's a different number of attributes in the train and test files. In the GUI, this can be solved by checking "Output predictions". How to do something similar using the API? do you know of any samples out there? import weka.classifiers.bayes.NaiveBayes; import weka.classifiers.meta.FilteredClassifier; import weka.classifiers.trees.J48; import weka

How much text can Weka handle?

风流意气都作罢 提交于 2019-12-12 04:58:20
问题 I have a sentiment analysis task and I need to specify how much data (in my case text) weka can handle. I have a corpus of 2500 opinions already tagged. I know that it´s a small corpus but my thesis advisor is asking me to specifically argue on how much data can Weka handle. 回答1: Your limitation with Weka will be on whatever learning algorithm you use and how much memory you have available for training. Most classifiers require the whole set be loaded into memory for training, but there are

How to write data.frame into arff using R

痞子三分冷 提交于 2019-12-12 04:33:03
问题 Weka can read csv files, however, if csv file's format is not fully satisfy Arff file standard, it may cause some problem. For example, I found loading a time series CSV file to Weka cause errors repeatedly. There have been some posts on using python to convert csv to arff online, but I think the code is a little lengthy and not always work. Is there a safer and quick way to convert csv to arff in R? 回答1: Simple, use the package RWeka library(RWeka) write.arff(iris, file = "iris.arff") 回答2:

How to find frequent itemset irrespective of attribute name?

*爱你&永不变心* 提交于 2019-12-12 04:18:11
问题 I have a dataset (CSV file) to find frequent itemsets using Apriori algorithm. col1, col2, col3 bread, butter,? coke, bread, butter I am using WEKA for this purpose. The ouput is in the following format: ... Large Itemsets L(2): col1=bread col2= butter 1 col1=coke col2= bread 1 col1=coke col3= butter 1 col2= bread col3= butter 1 ... But the output that I am want is : bread, butter 2 Basically, the above output is independent of the col that they belong to. How can I achieve this kind of