Re: [R] Making model predictions

2021-02-28 Thread Jeff Reichman
Rui Actually yes. I was able to work this into my shiny app this afternoon. Thank you Jeff -Original Message- From: Rui Barradas Sent: Sunday, February 28, 2021 5:26 AM To: reichm...@sbcglobal.net; R-help@r-project.org Subject: Re: [R] Making model predictions Hello, Are you

Re: [R] Making model predictions

2021-02-28 Thread Rui Barradas
Hello, Are you looking for this? newd <- data.frame( Class = '1st', Sex = 'Male', Age = 'Child' ) predict(m, newdata = newd, type = 'raw') #No Yes #[1,] 0.3169345 0.6830655 With the default type = 'class' the result is predict(m, newdata = newd) #[1] Yes #Levels: No Y

Re: [R] Making model predictions

2021-02-27 Thread Bert Gunter
The standard approach for prediction is via a predict() method for the class of the model fit. So, have you checked ?predict.naiveBayes If this does not satisfy your needs, you are on your own. Possibly your best course of action then is to contact the maintainer as the posting guide (linked belo

[R] Making model predictions

2021-02-27 Thread Jeff Reichman
R User Forum Is there a better way than grabbing individual cell values from a model output to make predictions. For example the output from the following Naïve Bayes model library(e1071) ## Example of using a contingency table: data(Titanic) m <- naiveBayes(Survived ~ ., data = Titanic) m wi