weka

Create a new weka Instance

拜拜、爱过 提交于 2019-12-03 21:17:24
I'm new in Weka, I'm triying to create new instances to be labeled with a previous trained MultilayerPerceptron , I did't know very much about how to create an instance so I got the first instance from my training data and then modified it by changing the atributes values: //Opening the model public boolean abrirModelo(String ruta) { try { clasificador = (MultilayerPerceptron) weka.core.SerializationHelper.read(ruta); return true; } catch (IOException e) { System.out.println("Fallo la lectura del archivo"); return false; } catch (ClassNotFoundException a) { System.out.println("Fallo el casting

How to use pre-trained .model file for predictions in Android Studio?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 20:43:18
I have trained a Decision Table ML model in Weka 3.8 Dekstop Version. I have saved the model accordingly in my assets folder and configured the wekaSTRIPPED.jar file as well. At this point, the build seems to be working fine on Android Studio. However, when I try to use the classification model in Java, I am getting some red highlights - errors - over my code which I am unable to autofix. I have visited some online guides here and visited this commonly used weka-android reference here and here . They follow the same structure as what I have been doing in my code (with different models), but

Get prediction percentage in WEKA using own Java code and a model

大憨熊 提交于 2019-12-03 16:23:59
Overview I know that one can get the percentages of each prediction in a trained WEKA model through the GUI and command line options as conveniently explained and demonstrated in the documentation article " Making predictions " . Predictions I know that there are three ways documented to get these predictions: command line GUI Java code/using the WEKA API, which I was able to do in the answer to " Get risk predictions in WEKA using own Java code " this fourth one requires a generated WEKA .MODEL file I have a trained .MODEL file and now I want to classify new instances using this together with

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

可紊 提交于 2019-12-03 16:17:09
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 and now i want to use the HMMWeka for classification. On the website it states that Data instances must

How to retrieve class values from WEKA using MATLAB

为君一笑 提交于 2019-12-03 15:36:33
I'm trying to retrieve classes from WEKA using MATLAB and WEKA API. All looks fine but classes are always 0. Any idea ?? My data set has 241 atributes, applying WEKA to this dataset I'm obtaining correct results. 1st train and test objects are created than classifier is build and classifyInstance performed. But this give wrong result train = [xtrain ytrain]; test = [xtest]; save ('train.txt','train','-ASCII'); save ('test.txt','test','-ASCII'); %## paths WEKA_HOME = 'C:\Program Files\Weka-3-7'; javaaddpath([WEKA_HOME '\weka.jar']); fName = 'train.txt'; %## read file loader = weka.core

Skip feature when classifying, but show feature in output

三世轮回 提交于 2019-12-03 15:18:18
问题 I've created a dataset which contains +/- 13000 rows with +/- 50 features. I know how to output every classification result: prediction and actual, but I would like to be able to output some sort of ID with those results. So i've added a ID column to my dataset but I don't know how disregard the ID when classifying while still being able to output the ID with every prediction result. I do know how to select features to output with every prediction. 回答1: Use FilteredClassifier. See this and

How to use weka for predict results

ⅰ亾dé卋堺 提交于 2019-12-03 12:17:42
问题 Im new to weka and I'm confused with the tool. What I needed to do is im having a data set about fruit price and relating attributes and im trying to predict the specific fruit price using the data set. Since I'm new to weka I couldn't figure out how to do this task. Please help me or guide me to a tutorial about how to do predictions and what is the best method or the algorithm to do this task. Thank You. 回答1: If you want to know more about how to save a trained classifier and load the same

How to interpret Weka Logistic Regression output?

早过忘川 提交于 2019-12-03 12:10:42
问题 Please help interpret results of logistic regression produced by weka.classifiers.functions.Logistic from Weka library. I use numeric data from Weka examples: @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

Weka: How to get the probabilities of each class for the test instances

大城市里の小女人 提交于 2019-12-03 09:23:38
In the case of Weka's Explorer, is there any way to get the class probabilities of the test instances as classified by a Naive Bayes' classifier? In Weka Explorer on the Classify tab, click on More options... and tick Output predictions . Then Start the training and testing and the result shows you the probabilities of assigning each class for each test instance. 来源: https://stackoverflow.com/questions/10868233/weka-how-to-get-the-probabilities-of-each-class-for-the-test-instances

weka stringToWordVector filter stringOptions

帅比萌擦擦* 提交于 2019-12-03 09:09:29
I'm trying to filter a dataset using weka's java API. I've successfully filtered the attributes I want with a stringToWordVector filter in Weka's GUI but I can't seem to do the same in my java code. I copied and pasted the auto-generated filtering parameters and posted them into my code but am continuing to get errors. Currently, my code looks like this: Instances newInsts = new Instances(this.instances); StringToWordVector stringFilter = new StringToWordVector(); stringFilter.setOptions( weka.core.Utils.splitOptions("-R 1,2,3,4,8 -W 1000 -prune-rate -1.0 -N 0 -stemmer weka.core.stemmers