weka

Error in plot, formula missing

南楼画角 提交于 2019-11-29 06:45:56
I am trying to plot my svm model. library(foreign) library(e1071) x <- read.arff("contact-lenses.arff") #alt: x <- read.arff("http://storm.cis.fordham.edu/~gweiss/data-mining/weka-data/contact-lenses.arff") model <- svm(`contact-lenses` ~ . , data = x, type = "C-classification", kernel = "linear") The contact lens arff is the inbuilt data file in weka. However, now i run into an error trying to plot the model. plot(model, x) Error in plot.svm(model, x) : missing formula. The problem is that in in your model, you have multiple covariates. The plot() will only run automatically if your data=

Increase heap size in java for weka

老子叫甜甜 提交于 2019-11-29 00:54:06
问题 I'm trying to increase the heap size in java for weka which keeps crashing. I used the suggested line: > java -Xmx500m -classpath but I get the following error: -classpath requires class path specification I'm not sure what this means. Any suggestions? 回答1: What I found was the actual issue was in the file 'RunWeka.ini' in '\Program Files (x86)\Weka-3-6' . I opened it with notepad and in the middle of the file there is a line 'maxheap = 512m' . I changed the line to read 'maxheap=2000m' ,

How to reuse saved classifier created from explorer(in weka) in eclipse java

*爱你&永不变心* 提交于 2019-11-28 20:55:43
I have created a classifier in WEKA, i saved it on my hard-disk, now I want to use that classifier in eclipse using weka api. How can i do this? please guide me to this... thank you Here is an example of loading a model to predict the value of instances. The example model is a J48 decision tree created and saved in the Weka Explorer. It was built from the nominal weather data provided with Weka. It is called "tree.model". //load model String rootPath="/some/where/"; Classifier cls = (Classifier) weka.core.SerializationHelper.read(rootPath+"tree.model"); //predict instance class values

How to read a text file with mixed encodings in Scala or Java?

扶醉桌前 提交于 2019-11-28 16:19:43
I am trying to parse a CSV file, ideally using weka.core.converters.CSVLoader. However the file I have is not a valid UTF-8 file. It is mostly a UTF-8 file but some of the field values are in different encodings, so there is no encoding in which the whole file is valid, but I need to parse it anyway. Apart from using java libraries like Weka, I am mainly working in Scala. I am not even able to read the file usin scala.io.Source: For example Source. fromFile(filename)("UTF-8"). foreach(print); throws: java.nio.charset.MalformedInputException: Input length = 1 at java.nio.charset.CoderResult

Text mining with PHP [closed]

若如初见. 提交于 2019-11-28 16:01:51
问题 I'm doing a project for a college class I'm taking. I'm using PHP to build a simple web app that classify tweets as "positive" (or happy) and "negative" (or sad) based on a set of dictionaries. The algorithm I'm thinking of right now is Naive Bayes classifier or decision tree. However, I can't find any PHP library that helps me do some serious language processing. Python has NLTK (http://www.nltk.org). Is there anything like that for PHP? I'm planning to use WEKA as the back end of the web

Creating a string attribute in Weka Java API

陌路散爱 提交于 2019-11-28 13:43:52
I'm trying to create a new string Attribute using Weka's Java API... Reading through the API javadocs, it appears that the way to do so is to use this constructor: Attribute public Attribute(java.lang.String attributeName, FastVector attributeValues) Constructor for nominal attributes and string attributes. If a null vector of attribute values is passed to the method, the attribute is assumed to be a string. Parameters: attributeName - the name for the attribute attributeValues - a vector of strings denoting the attribute values. Null if the attribute is a string attribute. but I'm stuck as to

Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?

半城伤御伤魂 提交于 2019-11-28 10:17:45
I am using Weka import weka.core.Instances; import weka.core.converters.ConverterUtils.DataSource; . . DataSource source; source = new DataSource("somecsvfile.csv"); I get following printed on console in red color in eclipse: ---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

Weka: Results of each fold in 10-fold CV

对着背影说爱祢 提交于 2019-11-28 10:09:35
For Weka Explorer (GUI), when we do a 10-fold CV for any given ARFF file, then what Weka Explorer provides (as far as I can see) is the average result for all the 10 folds. Q. Is there any way to get the results of each fold? For instance, I need the error rates (incorrectly identified instances) for each fold. Help appreciated. I think this is possible using Weka's GUI. You need to use the Experimenter though instead of the Explorer. Here are the steps: Open the Experimenter from the GUI Chooser Create a new experiment ( New button @ top-right) [optional] Enter a filename and location in the

unary class text classification in weka?

一世执手 提交于 2019-11-28 10:08:41
问题 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

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

烈酒焚心 提交于 2019-11-28 09:55:13
问题 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.