similar to: NaiveBayes fails with one input variable (caret and klarR packages)

Displaying 20 results from an estimated 400 matches similar to: "NaiveBayes fails with one input variable (caret and klarR packages)"

2010 Nov 03
2
[klaR package] [NaiveBayes] warning message numerical 0 probability
Hi, I run R 2.10.1 under ubuntu 10.04 LTS (Lucid Lynx) and klaR version 0.6-4. I compute a model over a 2 classes dataset (composed of 700 examples). To that aim, I use the function NaiveBayes provided in the package klaR. When I then use the prediction function : predict(my_model, new_data). I get the following warning : "In FUN(1:747[[747L]], ...) : Numerical 0 probability with
2007 Oct 30
1
NAIVE BAYES with 10-fold cross validation
hi there!! i am trying to implement the code of the e1071 package for naive bayes, but it doens't really work, any ideas?? i am very glad about any help!! i need a naive bayes with 10-fold cross validation: code: library(e1071) model <- naiveBayes(code ~ ., mydata) tune.control <- tune.control(random = FALSE, nrepeat = 1, repeat.aggregate = min, sampling = c("cross"),
2010 Jun 30
1
help on naivebayes function in R
Hi, I have written a code in R for classifying microarray data using naive bayes, the code is given below: library(e1071) train<-read.table("Z:/Documents/train.txt",header=T); test<-read.table("Z:/Documents/test.txt",header=T); cl <- c(c(rep("ALL",10), rep("AML",10))); cl <- factor(cl) model <- NaiveBayes(train,cl);
2006 Jul 24
2
RandomForest vs. bayes & svm classification performance
Hi This is a question regarding classification performance using different methods. So far I've tried NaiveBayes (klaR package), svm (e1071) package and randomForest (randomForest). What has puzzled me is that randomForest seems to perform far better (32% classification error) than svm and NaiveBayes, which have similar classification errors (45%, 48% respectively). A similar difference in
2010 Feb 01
2
Missing names in LMER and GLM
I'm having trouble with 'lmer' and would really appreciate it if anybody could help. I am trying to run generalized linear mixed effect model, and am using 'lmer', but some of the names inside the data do not show up in the summary after I compute the 'lmer'. As a close example of the data I have, the objects are Calls = MM, MB, MM, MM, MN, MNX, MNX, ... -this
2012 Feb 07
2
predict.naiveBayes() bug in e1071 package
Hi, I'm currently using the R package e1071 to train naive bayes classifiers and came across a bug: When the posterior probabilities of all classes are small, the result from the predict.naiveBayes function become NaNs. This is an issue with the treatment of the log-transformed probabilities inside the predict.naiveBayes function. Here is an example to demonstrate the problem (you might need
2007 Nov 01
1
RWeka and naiveBayes
Hi I'm trying to use RWeka to use a NaiveBayes Classifier(the Weka version). However it crashes whenever there is a NA in the class Gender Here is the.code I have with d2 as the data frame. The first call to NB doesn't make R crash but the second call does. NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayesSimple") d2[,64]<-d2$Gender=="M"
2012 Feb 10
2
naiveBayes: slow predict, weird results
I did this: nb <- naiveBayes(users, platform) pl <- predict(nb,users) nrow(users) ==> 314781 ncol(users) ==> 109 1. naiveBayes() was quite fast (~20 seconds), while predict() was slow (tens of minutes). why? 2. the predict results were completely off the mark (quite the opposite of the expected overfitting). suffice it to show the tables: pl: android blackberry ipad
2007 Aug 22
1
"subscript out of bounds" Error in predict.naivebayes
I'm trying to fit a naive Bayes model and predict on a new data set using the functions naivebayes and predict (package = e1071). R version 2.5.1 on a Linux machine My data set looks like this. "class" is the response and k1 - k3 are the independent variables. All of them are factors. The response has 52 levels and k1 - k3 have 2-6 levels. I have about 9,300 independent variables
2010 Oct 05
6
SVM functions
Hi ! Right now I am learning to use svm functions available in R and trying to use these function with given example. I was stuck with svmlight function which is available in klaR package. Any help would be appreciated regarding this function. 1. I am unable to use svmlight( ) which is available in package: klaR. Although I have downloaded klaR_0.6-3 package from
2008 Jun 25
1
Extract naiveBayes details
Hey, I just like to know how to extract details from the naiveBayes model (package e1071). I mean, for each possible value the model defines how much it influences the outcome. I want to sort those probabilities and show the values with the highest impact. How could I do that? PS: I tried using []'s to get to the model's internals, however, all I get is a "list" not a
2012 Aug 09
2
Analyzing Poor Performance Using naiveBayes()
My data is 50,000 instances of about 200 predictor values, and for all 50,000 examples I have the actual class labels (binary). The data is quite unbalanced with about 10% or less of the examples having a positive outcome and the remainder, of course, negative. Nothing suggests the data has any order, and it doesn't appear to have any, so I've pulled the first 30,000 examples to use as
2009 Feb 19
1
Bug in predict function for naiveBayes?
Dear all, I tried a simple naive Bayes classification on an artificial dataset, but I have troubles getting the predict function to work with the type="class" specification. With type= "raw", it works perfectly, but with type="class" I get following error : Error in as.vector(x, mode) : invalid 'mode' argument Data : mixture.train is a training set with 100
2007 Aug 31
1
Question on shardsplot
Dear All, Would you please tell me how to display the sample No. on the map ? ---Below commands don't display the sample No.(from 1 to 150).--- library(som) library(klaR) iris.som3 <- som(iris[,1:4], xdim = 14,ydim = 6) library(klaR); opar<- par(xpd = NA) shardsplot(iris.som3, data.or = iris,label = TRUE) legend(3.5,14.3, col = rainbow(3), xjust =0.5, yjust = 0,legend =
2007 Oct 03
1
help with stepclass (klaR)
I use Windows, R version 2.5.1 When I try to run stepclass (klaR) I get an error message/warning saying: 1: error(s) in modeling/prediction step in: cv.rate(vars = c(model, tryvar), data = data, grouping = grouping, ... Actually, I look 16 warnings of this type. Can anyone tell me what this means? Also, it returns only 2 out of the 79 variables as important, however these variables
2005 Jul 05
1
Getting runtime error in stepclass
Hi! I got the following runtime error when I tried to use svm method with stepclass. Error in "colnames<-"(`*tmp*`, value = c("0", "1")) : attempt to set colnames on object with less than two dimensions I repeated the same sequence of statements but this time I used the classification function used in the example, i.e., "lda" and it worked fine
2005 Jul 19
1
a possible bug in svmlight (PR#8012)
When I used svmlight, I got below error: my command is: foo <- svmlight(y~., data= myData) the results: Error in file(con, "r") : unable to open connection In addition: Warning messages: 1: svm_learn not found 2: cannot open file '_model_1.txt' > myData[1:2,] y X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 1 1 63 1 0 0 145 233 1 1 0 150 0 2.3 1
2010 Mar 09
1
create picture (k -the nearest neighbours)
Hi I want to create a nice picture about my result of k -the nearest neighbours algorithm. Here is my easy code: ################################# library(klaR) library(ipred) library(mlbench) data(PimaIndiansDiabetes2) dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)] dane[,2]=log(dane[,2]) dane[,1:2]=scale(dane[,1:2]) zbior.uczacy=sample(1:nrow(dane),nrow(dane)/2,F)
2011 Feb 27
2
regularized dfa rda (Klar): problems with predictions
Dear all, I am trying to do a n-fold cross-validation for a regularized discrimant function analysis using rda from the package klaR. However, I have problems to predict the groups from the test/validation sample. The exmaples of the R documantation and some online webpage also do not work. Does anybody know what I have done wrong? Here my code # I want to use the first 6 observations for
2006 Oct 22
1
Question:shardsplot (package:klaR)
Dear all, I have a question on the shardsplot package:klaR(see the below Example). Plese tell me the meanings of " logstand <- t((t(logcount) / sdlogcount) * c(1,2,6,5,5,3))", much more. Why does this example use "c(1,2,6,5,5,3)" ? Examples: # Compute clusters and an Eight Directions Arranged Map for the # country data. Plotting the result.