weka

Example for svm feature selection in R

∥☆過路亽.° 提交于 2019-12-02 18:36:57
I'm trying to apply feature selection (e.g. recursive feature selection) in SVM, using the R package. I've installed Weka which supports feature selection in LibSVM but I haven't found any example for the syntax of SVM or anything similar. A short example would be of a great help. The function rfe in the caret package performs recursive feature selection for various algorithms. Here's an example from the caret documentation : library(caret) data(BloodBrain, package="caret") x <- scale(bbbDescr[,-nearZeroVar(bbbDescr)]) x <- x[, -findCorrelation(cor(x), .8)] x <- as.data.frame(x) svmProfile <-

How to convert a text file into ARFF format?

大城市里の小女人 提交于 2019-12-02 16:45:03
问题 I'm using WEKA tool for text classification, and I have to convert plain text files into ARFF format. However, I don't know how to do that. Can anyone please help me to convert a text file into ARFF format? Thank you Renklauf for ur response, I didn't understood these points "Since text editors like Notepad only allow a limited number of columns, you'll need to get something like Notepad++ to fit everything on one line." .. can u plz explain in brief .. Suppose the text data is like a simple

IndexOutOfBoundsException when trying to add more instances to training set using Weka

筅森魡賤 提交于 2019-12-02 16:35:15
问题 I am trying to add more Instances to my training set and perform 10-fold cross validation. My instances are in String format so i use the StringToWordVector filter to transform them to numbers. Things work well if i do not add the extra pages i want. But when i add the command trainSet.addAll(data2); and pass trainSet to the filter i get a strange IndexOutOfBoundsException in the first iteration at Instances fTrainSet = Filter.useFilter(trainSet, filter); Instances data = getDataFromFile(

How to interpret weka classification?

≡放荡痞女 提交于 2019-12-02 14:03:01
How can we interpret the classification result in weka using naive bayes? How is mean, std deviation, weight sum and precision calculated? How is kappa statistic, mean absolute error, root mean squared error etc calculated? What is the interpretation of the confusion matrix? michaeltwofish Below is some sample output for a naive Bayes classifier, using 10-fold cross-validation. There's a lot of information there, and what you should focus on depends on your application. I'll explain some of the results below, to get you started. === Stratified cross-validation === === Summary === Correctly

Test a single instance in Weka

我与影子孤独终老i 提交于 2019-12-02 12:19:44
Does weka require the test instances to have the class attribute. I have used a training set arff file to train the classifier. Now I want to test an instance (not from arff file, have to create by code) without the class attribute and predict the class. I found this link Weka: How do I get the prediction value in java for a test instance? But my class attribute is a string 'Y' or 'N'. If evaluateModelOnce() returns double, what does it mean. Is it the class attribute or something else. i am using the weka API. To test instances, the instances must have class labels. Even if you provide class

Where can I find practical example of KNN in java using weka

▼魔方 西西 提交于 2019-12-02 11:53:38
问题 I have been searching for a practical example of KNN implementation using weka, but all I find is too general for me to understand the data that it needs to be able to work (or maybe how to make the objects that it needs to work) and also the results it shows, maybe someone that has worked with it before has a better example like with realistic things (products, movies, books, etc) and not the typical letters you see on algebra. So I can figure out how to implement it on my case (which is

How to convert a text file into ARFF format?

两盒软妹~` 提交于 2019-12-02 11:00:51
I'm using WEKA tool for text classification, and I have to convert plain text files into ARFF format. However, I don't know how to do that. Can anyone please help me to convert a text file into ARFF format? Thank you Renklauf for ur response, I didn't understood these points "Since text editors like Notepad only allow a limited number of columns, you'll need to get something like Notepad++ to fit everything on one line." .. can u plz explain in brief .. Suppose the text data is like a simple sport article like " Basketball is a team sport, the objective being to shoot a ball through a basket

IndexOutOfBoundsException when trying to add more instances to training set using Weka

不羁岁月 提交于 2019-12-02 08:26:40
I am trying to add more Instances to my training set and perform 10-fold cross validation. My instances are in String format so i use the StringToWordVector filter to transform them to numbers. Things work well if i do not add the extra pages i want. But when i add the command trainSet.addAll(data2); and pass trainSet to the filter i get a strange IndexOutOfBoundsException in the first iteration at Instances fTrainSet = Filter.useFilter(trainSet, filter); Instances data = getDataFromFile("pathtofile.arff");//main dataset 1821 instances Instances data2 = getDataFromFile("anotherpath.arff");/

Same Instances header ( arff ) for all my database queries

怎甘沉沦 提交于 2019-12-02 07:34:51
I am using InstanceQuery , SQL queries, to construct my Instances . But my query results does not come in the same order always as it is normal in SQL. Beacuse of this Instances constucted from different SQL has different headers. A simple example can be seen below. I suspect my results changes because of this behavior. Header 1 @attribute duration numeric @attribute protocol_type {tcp,udp} @attribute service {http,domain_u} @attribute flag {SF} Header 2 @attribute duration numeric @attribute protocol_type {tcp} @attribute service {pm_dump,pop_2,pop_3} @attribute flag {SF,S0,SH} My question is

Where can I find practical example of KNN in java using weka

此生再无相见时 提交于 2019-12-02 07:05:57
I have been searching for a practical example of KNN implementation using weka, but all I find is too general for me to understand the data that it needs to be able to work (or maybe how to make the objects that it needs to work) and also the results it shows, maybe someone that has worked with it before has a better example like with realistic things (products, movies, books, etc) and not the typical letters you see on algebra. So I can figure out how to implement it on my case (which is recommend dishes to active user with KNN), would be highly appreciated, thanks. I was trying to understand