Question



Predicting Using Naive Bayes

Dr. Ballings,

Within my prediction in naive Bayes, the column that I create in the prediction table that will contain the predicted dependent variable
contains only one value that is repeated throughout the table. Do you know why that might be the case? Additionally, I am not certain that R
knows to predict the data for Jan 3 (I don't think anything below is specifying that change)

NYSE_pred[,"predNB"] <- predict(NB,NYSE_pred[,c("V3","V6")], type = "raw", threshold = 0.001)[,2]








Answers and follow-up questions





Answer or follow-up question 1

Dear student,

Can you elaborate on `contains only one value that is repeated throughout the table'?

Are you saying it is a vector of values? If yes, that is normal.


The second part of your question:
`Additionally, I am not certain that R knows to predict the data for Jan 3 (I don't think anything below is specifying that change)'

If you use data of Jan 2, the prediction will be for Jan 3 (provided that you have a leading variable in your basetable).

Michel Ballings


Answer or follow-up question 2

Dr. Ballings,

Actually, it calculated one value (0.237581423) 200 times.


Answer or follow-up question 3

Dear student,

Can you post the output of NB?

Thanks,
Michel Ballings



Sign in to be able to add an answer or mark this question as resolved.