Displaying 20 results from an estimated 1000 matches similar to: ""subscript out of bounds" Error in predict.naivebayes"
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
2009 Jun 30
2
NaiveBayes fails with one input variable (caret and klarR packages)
Hello,
We have a system which creates thousands of regression/classification models and in cases where we have only one input variable NaiveBayes throws an error. Maybe I am mistaken and I shouldn't expect to have a model with only one input variable.
We use R version 2.6.0 (2007-10-03). We use caret (v4.1.19), but have tested similar code with klaR (v.0.5.8), because caret relies on
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
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);
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
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
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
2012 Feb 09
1
Tr: Re: how to pass weka classifier options with a meta classifier in RWeka?
Le jeudi 09 f?vrier 2012 ? 15:31 +0200, Kari Ruohonen a ?crit :
> Hi,
> I am trying to replicate a training of AttributeSelectedClassifier with
> CFsSubsetEval, BestFirst and NaiveBayes that I have initially done with
> Weka. Now, I am trying to use RWeka in R.
>
> I have a problem of passing arguments to the CfsSubsetEval, BestFirst
> and NaiveBayes. I have first created an
2012 May 04
1
weird predict function error when I use naive bayes
Hi,
I tried to use naivebayes in package 'e1071'.
when I use following parameter, only one predictor, there is an error.
> m<- naiveBayes(iris[,1], iris[,5])
> table(predict(m, iris[,1]), iris[,5])
Error in log(sapply(attribs, function(v) { :
Non-numeric argument to mathematical function
However, when I use two predictors, there is not error any more.
> m<-
2012 May 05
1
what is Non-numeric argument to mathematical function in prediction ?
Hi,
I tried to use naivebayes in package 'e1071'.
when I use following parameter, only one predictor, there is an error.
> m <- naiveBayes(iris[,1], iris[,5])
> table(predict(m, iris[,1]), iris[,5])
Error in log(sapply(attribs, function(v) { :
Non-numeric argument to mathematical function
However, when I use two predictors, there is not error any more.
> m <-
2011 Feb 08
1
Naive Bayes Issue - Can't Predict - Error is "Error in log(sapply(attribs...)
Hey guys,
I can't get my Naive Bayes model to predict. Forgive me if its simple...
I've tried about everything and can't get it to work. Reproduceable code
below.
Thank you,
Mike
--
Michael Schumacher
Manager Data & Analytics - ValueClick
mike.schumacher@gmail.com
*
Functional Example Code from UCLA:
2012 Jun 24
1
MuMIn for GLM Negative Binomial Model
Hello
I am not able to use the MuMIn package (version 1.7.7) for multimodel inference with a GLM Negative Binomial model (It does work when I use GLM Poisson). The GLM Negative Binomial gives the following error statement:
Error in get.models(NBModel, subset = delta < 4) :
object has no 'calls' attribute
Here is the unsuccessful Negative Binomial code.
>
> BirdNegBin
2007 Sep 25
1
10- fold cross validation for naive bayes(e1071)
Hallo!
I would need a code for 10-fold cross validation for the classifiers Naive Bayes and svm (e1071) package. Has there already been done something like that?
I tried to do it myself by applying the tune function first:
library(e1071)
tune.control <- tune.control(random =F, nrepeat=1, repeat.aggregate=min.,sampling=c("cross"),sampling.aggregate=mean, cross=10, best.model=T,
2014 Jun 12
1
do.call Error for Function Not Present When Manually Called
Hello,
The e1071 function naiveBayes gives an error when called by do.call, although it doesn't give any error if I call it manually.
Browse[1]> trainParams at classifier
function (x, ...)
UseMethod("naiveBayes")
<environment: namespace:e1071>
Browse[1]> trained <- do.call(trainParams at classifier, paramList)
Error in names(dimnames(tables[[i]])) <- c(Yname,
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"),
2007 Jan 19
1
naive bayes help
Hello
I have a rather simple code and for some reason it produces an error
message. If someone can tell me why and how to fix it, I would be very
greatful. Thank you in advance.
##### create data
set.seed(10)
n <- 200 # number of training points
n.test <- 200 # number of test points
p<-2 # dimension of input space
z <-
2010 Aug 30
2
Regarding naive baysian classifier in R
Hi,
I have a small doubt regarding naive Bayes. I am able to classify the
data's properly but i am just stuck up with how to get the probability
values for naive bayes. In the case of SVM we have "attr" function that
helps in displaying the probability values. Is there any function similar to
"attr" in naive Bayes that can be used for displaying the attribute values.
my
2012 Jul 05
1
Different level set when predicting with e1071's Naive Bayes classifier
Hi!
I'm using the Naive Bayes classifier provided by the e1071 package (
http://cran.r-project.org/web/packages/e1071) and I've noticed that the
predict function has a different behavior when the level set of the columns
used for prediction is different from the ones used for fitting. From
inspecting the predict.naiveBayes I came to the conclusion that this is due
to the conversion of