weka

Java第三方工具库/包汇总

一个人想着一个人 提交于 2019-11-29 21:33:54
一、科学计算或矩阵运算库 科学计算包: JMathLib 是一个用于计算复杂数学表达式并能够图形化显示计算结果的Java开源类库。它是Matlab、Octave、FreeMat、Scilab的一个克隆,但完全采用纯Java实现。 JSci :Java 科学对象(JSci)开放源代码项目是 Durham(英国 Durham)大学粒子理论中心的三年级研究生 Mark Hale 创立的。JSci 是一个包集合,包含数学和科学类。 使用 JSci,您既可以在 AWT 中也可以在 Swing 中创建简单的条形图、折线图和饼形图。 JSci.swing.JBarGraph 、 JSci.swing.JPieChart 和 JSci.swing.JLineGraph API 组件设计得也很好,这些组件和 AWT 绘图类都遵守 MVC 体系结构。 JScience : http://jscience.org/ JScience 是一个Java的科学计算包 jLab :jLab是数值计算的Java执行环境。该jLab环境的目的是提供一个基于Matlab / Scilab喜欢的科学计算平台所支持的脚本引擎执行的Java语言。 The current jLab ND4J :在JVM上实现快速的科学计算;ND4J是一个开源的数值计算扩展 ,它将 Python中著名的 numpy

Method undefined for type Java

让人想犯罪 __ 提交于 2019-11-29 18:01:20
Having real trouble figuring out where i'm going wrong on this one. Building a system using WEKA in java to study associations and am trying to implement the Apriori algorithm. Currently this is the code: package model; import weka.associations.*; import weka.core.Instances; import weka.core.converters.ConverterUtils.DataSource; public class Apriori { public static void main(String args[]) throws Exception { String dataset = "/Users/andrew/workspace/Movies/src/data/tagsfinal.arff"; DataSource dsource = new DataSource(dataset); Instances dapriori = dsource.getDataSet(); Apriori apriori = new

Does test file in weka requires same or less number of features as train?

时光怂恿深爱的人放手 提交于 2019-11-29 15:54:24
I have prepared two different .arff files from two different datasets one for testing and other for training. Each of them have equal instances but different features changing the dimensionality of feature vector for each file. When i did cross-validation on each of these files, they are working perfectly. This shows .arff files are properly prepared and don't have any error. Now if i use the train file having less dimensionality compared to test file for evaluation. I get a following error. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5986 at weka.classifiers.bayes

unary class text classification in weka?

橙三吉。 提交于 2019-11-29 15:49:26
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 should I do to get this behavior? The SMO algorithm in Weka

Adding an instance to Instances in weka

房东的猫 提交于 2019-11-29 15:46:04
问题 I have a few arff files. I would like to read them sequentially and create a large dataset. Instances.add(Instance inst) doesn't add string values to the instances, hence the attempt to setDataset() ... but even this fails. Is there a way to accomplish the intuitively correct thing for strings? ArffLoader arffLoader = new ArffLoader(); arffLoader.setFile(new File(fName)); Instances newData = arffLoader.getDataSet(); for (int i = 0; i < newData.numInstances(); i++) { Instance one = newData

Increase heap to avoid Out of Memory Error in WEKA

冷暖自知 提交于 2019-11-29 14:13:50
I am trying to run a classifier in WEKA, using a J48 classifier using the following command line: $ java -Xmx2048m -cp /home/weka-3-7-9/weka.jar weka.classifiers.trees.J48 -t input.arff -i -k -d J48-data.model & Although the size of my arff is 43.8 M, and I aumented the heap space to 2048m, I still received the following errors: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.ArrayList.<init>(ArrayList.java:132) at weka.core.Instances.initialize(Instances.java:196) at weka.core.Instances.<init>(Instances.java:177) at weka.classifiers.trees.j48

weka.core.UnassignedDatasetException when creating an unlabeled instance

冷暖自知 提交于 2019-11-29 12:43:48
问题 I trained an IBK classifier with some training data that I created manually as following: ArrayList<Attribute> atts = new ArrayList<Attribute>(); ArrayList<String> classVal = new ArrayList<String>(); classVal.add("C1"); classVal.add("C2"); atts.add(new Attribute("a")); atts.add(new Attribute("b")); atts.add(new Attribute("c")); atts.add(new Attribute("d")); atts.add(new Attribute("@@class@@", classVal)); Instances dataRaw = new Instances("TestInstances", atts, 0); dataRaw.setClassIndex

Adding database drivers to use WEKA classes

匆匆过客 提交于 2019-11-29 11:46:09
I tried to run the following command on the command-line: G:\Weka-3-6>java weka.core.converters.CSVLoader data.csv > data.arff This is the error message: ---Registering Weka Editors--- Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH? Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in

WEKA: how to get the score from classifyInstance?

穿精又带淫゛_ 提交于 2019-11-29 11:23:33
I'm using a FilteredClassifier.classifyInstance() to classify my instances in weka. I have 2 classes (true and false) and I have many positives, so I actually need to know the score of each isntance to get the best positive. You know how I could get the score from my weka classifier ? thanks Update: I've also tried to use distributionForInstance, but for each instance I always get an array with [1.0, 0.0]. I actually need to compare several instances to see which one is the most reliable, which one has more changes to have been classified correctly. Kerstin distributionForInstance(Instance

Weka J48 Classifier: Cannot handle numeric class?

人盡茶涼 提交于 2019-11-29 08:57:41
I'm now trying to build a J48 (C4.5) classifier model on my training data using Weka. First I do this, which seems to go OK: java -Xmx10G -cp /weka/weka.jar weka.core.converters.TextDirectoryLoader -dir /home/test/cats > /home/test/cats.arff This seems to go OK too: java -Xmx10G -cp /weka/weka.jar weka.filters.unsupervised.attribute.StringToWordVector -i /home/test/cats.arff -o /home/test/cats-vector.arff This does not go OK: java -Xmx10G -cp /weka/weka.jar weka.classifiers.trees.J48 -t /home/test/cats-vector.arff -d /home/test/cats.model It gives the following error: weka.core