Displaying 20 results from an estimated 10000 matches similar to: "Bug in predict function for 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
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 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);
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
2001 May 16
7
Naive Bayes Classifier
Dear r-users,
I am looking for an implementation of the Naive Bayes classifier for a
multi-class classification problem. I can not even find the Naive Bayes
classifier for two classes, though I can not believe it is not
available. Can anyone help me?
Uschi
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2012 Mar 22
1
predict () for LDA and GLM
Hi!
I'm using GLM, LDA and NaiveBayes for binomial classification. My training
set is 70 rows long with 32 features, and my test set is 30 rows long with
32 features.
Using Naive Bayes, I can train a model, and then predict the test set with
it like so:
ass4q1.dLDA = lda(ass4q1.trainSet[,1]~ass4q1.trainSet[,2:3])
table(predict(ass4q1.dNB, ass4q1.testSetDF[,2:3]), ass4q1.testSetDF[,1])
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
how to tabulate the prediction value using table function for naive baiyes 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);
2011 Jul 07
1
Naive Bayes Classifier
Hi,
Currently I testing the packets that contain built-in features for
classification. Actually I looked packages such as: e1071, Klar, Caret,
CORElearn. However, from what I noticed when building a naive Bayesian
classifier, that they package use of the finite mixture model to estimate P
(x | C) and using a normal distribution. In my research I use binary data
and I want modeled P (x | C), eg the
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:
2002 Dec 04
1
Mixture of Multivariate Gaussian Sample Data
Hey, I am confused about how to generate the sample data from a mixture of
Multivariate Gaussian ditribution.
For example, there are 2 component Gaussian with prior
probability of 0.4 and 0.6,
the means and variances are
u1=[1 1]', Cov1=[1 0;0 1]
and
u2=[-1 -1]', Cov2=[1 0;0 1]
repectively.
So how can I generate a sample of 500 data from the above mixture
distribution?
Thanks.
Fred
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 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
2018 Feb 26
3
Random Seed Location
Hi all,
For some odd reason when running na?ve bayes, k-NN, etc., I get slightly
different results (e.g., error rates, classification probabilities) from run
to run even though I am using the same random seed.
Nothing else (input-wise) is changing, but my results are somewhat different
from run to run. The only randomness should be in the partitioning, and I
have set the seed before this
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
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"
2018 Feb 27
0
Random Seed Location
In case you don't get an answer from someone more knowledgeable:
1. I don't know.
2. But it is possible that other packages that are loaded after set.seed()
fool with the RNG.
3. So I would call set.seed just before you invoke each random number
generation to be safe.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking
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
2001 Sep 03
8
mixture distributions
Dear List,
I am looking for a possibility to fit a mixture model under R using
maximum likelihood estimation.
Venables and Ripley describe a solution working under S+ (in MASS, 3. ed.,
p. 263) which requires the D system function and deriv3. This solution does not
seem to be portable to R or at least I do not realise how.
Is there anyone who
a) knows how one could make the MASS-method run under
2009 May 06
1
How to do Naive Bayes in R?
I am wondering if anybody here have a simple example in R for Naive
Bayes.
For example, I can do k-means clustering on the "iris" data -
data(iris)
cl <- kmeans(iris[,1:4], 3)
cl$cluster
cbind(1:150,iris$Species)
===========
But how to do Naive Bayes classification in the same "iris" data?
Many thanks!
--
View this message in context: