weka

How to use StringToWordVector (weka) in java?

核能气质少年 提交于 2020-01-03 20:04:58
问题 This is my arff file @relation hamspam @attribute text string @attribute class {ham,spam} @data 'good',ham 'very good',ham 'bad',spam 'very bad',spam 'very bad, very bad',spam What i want to do is to classify it with weka clasiffier in my java program, but i don't know how to use StringToWordVector and then classify it. this my code: Classifier j48tree = new J48(); Instances train = new Instances(new BufferedReader(new FileReader("data.arff"))); StringToWordVector filter = new

No classifiers in Weka Explorer

China☆狼群 提交于 2020-01-03 07:02:20
问题 I just found out about weka so I decided to try it out. I downloaded some training data: @relation weather @attribute outlook {sunny, overcast, rainy} @attribute temperature real @attribute humidity real @attribute windy {TRUE, FALSE} @attribute play {yes, no} @data sunny,85,85,FALSE,no sunny,80,90,TRUE,no overcast,83,86,FALSE,yes rainy,70,96,FALSE,yes rainy,68,80,FALSE,yes rainy,65,70,TRUE,no overcast,64,65,TRUE,yes sunny,72,95,FALSE,no sunny,69,70,FALSE,yes rainy,75,80,FALSE,yes sunny,75,70

How to use different scaling approaches in weka

陌路散爱 提交于 2020-01-03 04:54:11
问题 I am using logistic regression with my data in weka. Now I want to try different scaling approaches to improve my results, such as min/max, zero mean/unit, variance, length etc. Is there any option in weka for using scaling? 回答1: Weka includes methods for data preprocessing: weka.filters.unsupervised.attribute.Normalize weka.filters.unsupervised.attribute.Standardize In Java: Instances train_data = ... Instances test_data = ... Standardize filter = new Standardize(); filter.setInputFormat

Dummy Coding of Nominal Attributes - Effect of Using K Dummies, Effect of Attribute Selection

荒凉一梦 提交于 2020-01-02 18:04:43
问题 Summing up my understanding of the topic 'Dummy Coding' is usually understood as coding a nominal attribute with K possible values as K-1 binary dummies. The usage of K values would cause redundancy and would have a negative impact e.g. on logistic regression, as far as I learned it. That far, everything's clear to me. Yet, two issues are unclear to me: 1) Bearing in mind the issue stated above, I am confused that the 'Logistic' classifier in WEKA actually uses K dummies (see picture). Why

Java: How can I assemble/create a single instance for classification using a Weka generated model?

故事扮演 提交于 2020-01-01 19:20:15
问题 I've been searching for an answer to this for a while to no avail. First a bit of background: I'm trying to create an AI for robocode using Weka. I'm first logging the required data from a manual robot to an ARFF file, this is working as it should. This data is then processed this using Weka and a model created, I'm then saving this file. I can successfully import the model and classify a dataset that has been imported from another arff file and use the results. What I want to do now is every

How to resolve java.lang.RuntimeException: Stub! error in .java file?

[亡魂溺海] 提交于 2020-01-01 16:34:52
问题 I am trying to classify an instance using a .model file which I have created on the Weka GUI. It seems I have successfully classified the test instance, however, I am not sure whether I am able to successfully load my .model file and of the Stub compiler error. I have tried to remove the extends AppCompatActivity and if that makes any difference in the .model upload. It turns out that to use getAssets() , the code must be in an activity. However, I an still unsure of whether the model has

Java, Weka: How to predict numeric attribute?

孤人 提交于 2020-01-01 09:57:14
问题 I was trying to use NaiveBayesUpdateable classifier from Weka. My data contains both nominal and numeric attributes: @relation cars @attribute country {FR, UK, ...} @attribute city {London, Paris, ...} @attribute car_make {Toyota, BMW, ...} @attribute price numeric %% car price @attribute sales numeric %% number of cars sold I need to predict the number of sales (numeric!) based on other attributes. I understand that I can not use numeric attribute for Bayes classification in Weka. One

Train and test set are not compatible error in weka?

两盒软妹~` 提交于 2020-01-01 09:03:10
问题 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

Train and test set are not compatible error in weka?

谁说胖子不能爱 提交于 2020-01-01 09:02:14
问题 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

What is the equivalent for a Hidden Markov Model in the WEKA toolkit?

纵饮孤独 提交于 2020-01-01 05:48:08
问题 I need to classify a datastream which comes from a sensor network consisting of 8 accelerometers. Each accelerometer gives me a X Y and Z value. Thus at each sample i have 8 x 3 = 24 acceleration values. I sample at about 30 hz and the performance time is about 0.5 seconds. At first i thought of using a Hidden Markov model for this but it seems that the WEKA toolkit does not provide such a thing. What is the WEKA equivalent for this? Thank you. EDIT: how to format data? I have collected data