arff

Creating an ARFF file from python output

霸气de小男生 提交于 2019-12-06 22:26:05
问题 gardai-plan-crackdown-on-troublemakers-at-protest-2438316.html': {'dail': 1, 'focus': 1, 'actions': 1, 'trade': 2, 'protest': 1, 'identify': 1, 'previous': 1, 'detectives': 1, 'republican': 1, 'group': 1, 'monitor': 1, 'clashes': 1, 'civil': 1, 'charge': 1, 'breaches': 1, 'travelling': 1, 'main': 1, 'disrupt': 1, 'real': 1, 'policing': 3, 'march': 6, 'finance': 1, 'drawn': 1, 'assistant': 1, 'protesters': 1, 'emphasised': 1, 'department': 1, 'traffic': 2, 'outbreak': 1, 'culprits': 1,

Where should I save my file in Android for local access?

こ雲淡風輕ζ 提交于 2019-12-05 07:42:56
问题 I have two datasets which are currently in the same folder as my java files AND on my PC. Currently, I am accessing them through my C-drive. Since this is an app, where should I save my .ARFF files and what path should I use instead? I have tried in the raw folder, but nothing seems to work. Here's what I have so far... 回答1: Create a raw directory in your project, raw is included in the res folder of android project. You can add an assets files in raw folder like music files, database files

Simple text classification using naive bayes (weka) in java

穿精又带淫゛_ 提交于 2019-12-05 07:32:22
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,ham} @data 'good bad very bad',? 'good bad very bad',? 'good',? 'good very good',? 'bad',? 'very good'

Creating an ARFF file from python output

£可爱£侵袭症+ 提交于 2019-12-05 04:07:44
gardai-plan-crackdown-on-troublemakers-at-protest-2438316.html': {'dail': 1, 'focus': 1, 'actions': 1, 'trade': 2, 'protest': 1, 'identify': 1, 'previous': 1, 'detectives': 1, 'republican': 1, 'group': 1, 'monitor': 1, 'clashes': 1, 'civil': 1, 'charge': 1, 'breaches': 1, 'travelling': 1, 'main': 1, 'disrupt': 1, 'real': 1, 'policing': 3, 'march': 6, 'finance': 1, 'drawn': 1, 'assistant': 1, 'protesters': 1, 'emphasised': 1, 'department': 1, 'traffic': 2, 'outbreak': 1, 'culprits': 1, 'proportionate': 1, 'instructions': 1, 'warned': 2, 'commanders': 1, 'michael': 2, 'exploit': 1, 'culminating'

How to represent text for classification in weka?

北城以北 提交于 2019-12-05 03:16:21
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. 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 with words ... ',pos The text is represented as a String type and the class is a nominal with two values.

.arff files with scikit-learn?

こ雲淡風輕ζ 提交于 2019-12-04 11:49:10
问题 I would like to use an Attribute-Relation File Format with scikit-learn to do some NLP task, is this possible? How can use an .arff file with scikit-learn ? 回答1: I really recommend liac-arff. It doesn't load directly to numpy, but the conversion is simple: import arff, numpy as np dataset = arff.load(open('mydataset.arff', 'rb')) data = np.array(dataset['data']) 回答2: I found that scipy has a loader for arff files to load them as numpy record arrays. I am not 100% sure that those arrays are

Train and test set are not compatible error in weka?

孤街浪徒 提交于 2019-12-04 03:47:43
I'm trying to test my model with new dataset. I have done the same preprocessing step as i have done for building my model. I have compared two files but there is no issues. I have all the attributes(train vs test dataset) in same order, same attribute names and data types. But still i'm not able to resolve the issue. Both of the files train and test seems to be similar but the weka explorer is giving me error saying Train and test set are not compatible. How to resolve this error? Is there any way to make test.arff file format as train.arff? Please somebody help me. The same with the comment

Where should I save my file in Android for local access?

风流意气都作罢 提交于 2019-12-03 21:51:33
I have two datasets which are currently in the same folder as my java files AND on my PC. Currently, I am accessing them through my C-drive. Since this is an app, where should I save my .ARFF files and what path should I use instead? I have tried in the raw folder, but nothing seems to work. Here's what I have so far... Create a raw directory in your project, raw is included in the res folder of android project. You can add an assets files in raw folder like music files, database files or text files or some other files which you need to access directly 1) Right click on res folder, select New>

Counting bi-gram frequencies

≯℡__Kan透↙ 提交于 2019-12-03 14:04:30
问题 I've written a piece of code that essentially counts word frequencies and inserts them into an ARFF file for use with weka. I'd like to alter it so that it can count bi-gram frequencies, i.e. pairs of words instead of single words although my attempts have proved unsuccessful at best. I realise there's alot to look at but any help on this is greatly appreciated. Here's my code: import re import nltk # Quran subset filename = raw_input('Enter name of file to convert to ARFF with extension, eg.

.arff files with scikit-learn?

依然范特西╮ 提交于 2019-12-03 06:37:33
I would like to use an Attribute-Relation File Format with scikit-learn to do some NLP task, is this possible? How can use an .arff file with scikit-learn ? I really recommend liac-arff . It doesn't load directly to numpy, but the conversion is simple: import arff, numpy as np dataset = arff.load(open('mydataset.arff', 'rb')) data = np.array(dataset['data']) I found that scipy has a loader for arff files to load them as numpy record arrays. I am not 100% sure that those arrays are suitable for direct consumption by scikit-learn but that should get your started. Follow renatopp's answer: assume