similar to: How to do Naive Bayes in R?

Displaying 20 results from an estimated 2000 matches similar to: "How to do Naive Bayes in R?"

2010 Sep 16
2
parallel computation with plyr 1.2.1
Hi, I have been trying to use the new .parallel argument with the most recent version of plyr [1] to speed up some tasks. I can run the example in the NEWS file [1], and it seems to be working correctly. However, R will only use a single core when I try to apply this same approach with ddply(). 1. http://cran.r-project.org/web/packages/plyr/NEWS Watching my CPUs I see that in both cases
2008 Jun 04
2
estimate phase shift between two signals
Hi, Are there any functions in R that could be used to estimate the phase-shift between two semi-sinusoidal vectors? Here is what I have tried so far, using the spectrum() function -- possibly incorrectly: # generate some fake data, normalized to unit circle x <- jitter(seq(-2*pi, 2*pi, by=0.1), amount=pi/8) # functions defining two out-of-phase phenomena f1 <- function(x)
2008 Aug 29
7
model II regression - how do I do it?
An embedded and charset-unspecified text was scrubbed... Name: n?o dispon?vel URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080829/57df9fc7/attachment.pl>
2008 Jul 16
2
gstat problem with lidar data
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080716/338e44b9/attachment.pl>
2008 Aug 19
4
converting coordinates from utm to longitude / latitude
Hi, is there a function in R to convert data read with read.shape and which is originally in UTM coordinates into longitude / latitude coordinates? I found the convUL() function from the PBSmapping package but I have no idea how I could apply that to the read.shape object. Many thanks, Werner __________________________________________________ Do sragenden Schutz gegen Massenmails.
2007 Sep 20
2
Superimposing vector polygons over raster grid in a plot
Hello: I would like to superimpose vector polygons (state outlines) from a Shape file on top of a satellite image, imported into a SpatialGridDataFrame from GEOTIFF via gdal_translate and readGDAL. When I plot polygon and point shape files in R, into SpatialPointDataFrame and SpatialPolygonDataFrame, the two feature sets line up geographically, so it seems logical that a SpatialGridDataFrame
2008 Jun 09
3
piper diagram
Hi, Is anyone on the list familiar with an R implementation of Piper Diagrams? Example: http://faculty.uml.edu/nelson_eby/89.315/IMAGES/Figure%209-78.jpg I am thinking that two calls to triax.plot (plotrix) along with some kind of affine-transformed standard plot would do the trick. Not so sure about the final layout, or a nice generalized version for something like lattice. Cheers, Dylan
2007 Oct 08
1
do not plot polygon boundaries with spplot {sp}
Hi, Is there a simple way to suppress the plotting of polygon boundaries with spplot() ? # simple list of 12 colors cols <- brewer.pal(12, "Paired") # plot pile of polygons, with 12 classes: spplot(x, zcol='class2', col.regions=cols, scales=list(draw=T), xlab="Easting (m)", ylab="Northing (m)") ... seems to work well. However the polygon boundaries
2009 Jun 30
2
odd behaviour in quantreg::rq
Hi, I am trying to use quantile regression to perform weighted-comparisons of the median across groups. This works most of the time, however I am seeing some odd output in summary(rq()): Call: rq(formula = sand ~ method, tau = 0.5, data = x, weights = area_fraction) Coefficients: Value Std. Error t value Pr(>|t|) (Intercept) 45.44262 3.64706 12.46007
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,
2009 Oct 23
2
interpretation of RCS 'coefs' and 'knots'
Hi, I have fit a series of ols() models, by group, in this manner: l <- ols(y ~ rcs(x, 4)) ... where the series of 'x' values in each group is the same, however knots are not always identical between groups. The result is a table of 'coefs' derived from the ols objects, by group: group Intercept top top' top'' 1 6.864 0.01 2.241 -2.65
2008 Feb 13
1
use of poly()
Hi, I am curious about how to interpret the results of a polynomial regression-- using poly(raw=TRUE) vs. poly(raw=FALSE). set.seed(123456) x <- rnorm(100) y <- jitter(1*x + 2*x^2 + 3*x^3 , 250) plot(y ~ x) l.poly <- lm(y ~ poly(x, 3)) l.poly.raw <- lm(y ~ poly(x, 3, raw=TRUE)) s <- seq(-3, 3, by=0.1) lines(s, predict(l.poly, data.frame(x=s)), col=1) lines(s,
2009 Jul 09
3
Stratified data summaries
Hi All, I'm trying to automate a data summary using summary or describe from the HMisc package. I want to stratify my data set by patient_type. I was hoping to do something like: Describe(myDataFrame ~ patient_type) I can create data subsets and run the describe function one at a time, but there's got to be a better way. Any suggestions? Rachel [[alternative HTML
2008 Mar 05
1
testing for significantly different slopes
Hi, How would one go about determining if the slope terms from an analysis of covariance model are different from eachother? Based on the example from MASS: library(MASS) # parallel slope model l.para <- lm(Temp ~ Gas + Insul, data=whiteside) # multiple slope model l.mult <- lm(Temp ~ Insul/Gas -1, data=whiteside) # compare nested models: anova(l.para, l.mult) Analysis of Variance
2010 Feb 17
1
strangeness in Predict() {rms}
Hi, Running the following example from ?Predict() throws an error I have never seen before: set.seed(1) x1 <- runif(300) x2 <- runif(300) ddist <- datadist(x1,x2); options(datadist='ddist') y <- exp(x1+ x2 - 1 + rnorm(300)) f <- ols(log(y) ~ pol(x1,2) + x2) p1 <- Predict(f, x1=., conf.type='mean') Error in paste(nmc[i], "=", if (is.numeric(x))
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:
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"),
2008 Oct 13
2
Using an image background with graphics
I would like to use a map or aerial photo as a background to plotting solid lines and text, and semi-transparent color contours, in base and lattice graphics. Plot coordinates need to be consistent with the georeferenced background. For example, a color contour plot would have an gray-toned aerial photograph as a background for overprinted semi-transparent color contours of some spatially
2006 Dec 11
1
cohen kappa for two-way table
Greetings, I am a bit confused by the results returned by the functions: cohen.kappa {concord} classAgreement {e1071} when using a two-way table. for example, if I have an matrix A, and a similar matrix B (same dimensions), then: matrix A and B can be found: http://casoilresource.lawr.ucdavis.edu/drupal/files/a_40.txt http://casoilresource.lawr.ucdavis.edu/drupal/files/b_40.txt A <-
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