arff

Weka ignoring unlabeled data

谁说胖子不能爱 提交于 2019-12-18 08:55:45
问题 I am working on an NLP classification project using Naive Bayes classifier in Weka. I intend to use semi-supervised machine learning, hence working with unlabeled data. When I test the model obtained from my labeled training data on an independent set of unlabeled test data, Weka ignores all the unlabeled instances. Can anybody please guide me how to solve this? Someone has already asked this question here before but there wasn't any appropriate solution provided. Here is a sample test file:

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 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 remove particular attributes from arff file and produce modified arff?

被刻印的时光 ゝ 提交于 2019-12-11 13:28:48
问题 (not manually) i have 96 features and want to remove some 20 features from arff and produce modified arff. used weka for feature selection now want to remove those less imp features. can anyone suggest code for this 回答1: Here you go... just change the source and destination file path... import java.io.File; import weka.core.Instances; import weka.core.converters.ArffLoader; import weka.core.converters.ArffSaver; import weka.filters.Filter; import weka.filters.unsupervised.attribute.Remove;

Convert CSV in ARFF in android

妖精的绣舞 提交于 2019-12-11 07:32:58
问题 i have a cvs file that i want to convert in arff format. I add this external jar in my build path and in libs/: weka-3.6.6-android.jar My cvs file not have header row and it is like this: 0.56024569272995,0.34556102752685547,0.4986509583393733,0.025362752945036676,0.4992934039810014,0.56024569272995,0.34556102752685547,0.4986509583393733,0.025362752945036676,0.4992934039810014,0.56024569272995,0.34556102752685547,0.0,0.500127645839251,0.4992934039810014 0.5616480112075806,0.33134251832962036

Weka Clustering Results Differ for Same Settings

霸气de小男生 提交于 2019-12-11 06:29:53
问题 I am using Weka for clustering some data and was running into a very odd problem. When I use the normal "Cluster" Tool on a data set, I am getting a result of Cluster 1: 87 instances Cluster 2: 88 instances Cluster 3: 181 instances This is what I sort of expected from the data I had, so I consider this a good result. However, I want to add this cluster as a class and save it as a new .arff file, so I am trying to use the "Add Cluster" filter that Weka provides. Now, in this filter, I select

Weka csv to arff special characters caue error

给你一囗甜甜゛ 提交于 2019-12-11 05:02:25
问题 I'm new to Weka and having problems converting a CSV file containing Tweets into an Arff file. The CSV looks like this Tweet,Class Conference Update: 50% Off Registration to End .. http://t.co/nZtkSzZnJ6,Yes When I try to convert to .arff using Explorer, I receive the following error "...not recognized as an CSV data files Reason: wrong number of values. Read 1 expected 2, read token[EOF], line 2" Removing the "%" character allows the file to convert to arff without error. I could remove "%"

Simple text classification using naive bayes (weka) in java

馋奶兔 提交于 2019-12-10 04:35:09
问题 I try to do text classification naive bayes weka libarary in my java code, but i think the result of the classification is not correct, i don't know what's the problem. I use arff file for the input. this is my training data: @relation hamspam @attribute text string @attribute class {spam,ham} @data 'good',ham 'good',ham 'very good',ham 'bad',spam 'very bad',spam 'very bad, very bad',spam 'good good bad',ham this is my testing_data: @relation test @attribute text string @attribute class {spam

How to represent text for classification in weka?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 03:34:16
问题 Can you please let me know how to represent attribute or class for text classification in weka. By using what attribute can I do classification? word frequency or just word? What would be possible structure of ARFF format? Can you give me several lines of example of that structure? Thank you very much in advance. 回答1: One of the easiest alternatives is to start with an ARFF file for a two class problem like: @relation corpus @attribute text string @attribute class {pos,neg} @data 'long text

How to change attribute type to String (WEKA - CSV to ARFF)

空扰寡人 提交于 2019-12-08 23:15:31
I'm trying to make an SMS SPAM classifier using the WEKA library. I have a CSV file with "label" and "text" headings. When I use the code below, it creates an ARFF file with two attributes: @attribute label {ham,spam} @attribute text {'Go until jurong point','Ok lar...', etc.} Currently, it seems that the text attribute is formatted as a nominal attribute with each message's text as a value. But I need the text attribute to be a String attribute, not a list of all of the text from all instances. Having the text attribute as a String will allow me to use the StringToWordVector filter for