Description Usage Arguments Value Examples
You can use 'Predict_naBa' with any data frame.
1 2 | predict_naBa(prior, newdata, type = c("class", "raw"), eps = 0,
threshold = 0.001)
|
prior |
Prior information. (output of Info_prior()) |
newdata |
with the same format as prior dataset. (Output of prep()) |
type |
Type of outcome you want: "Class" prediction or "Raw" probabilities. |
eps |
A small number to specify an epsilon-range for Laplace smoothing; default=0. |
threshold |
Replace cells value under epsilon range; default=0.001. |
'output': If type="class", returns a vector of predicted classes ; If type="raw", returns a matrix of conditional probabilities.
1 2 3 4 5 6 | data(mood)
x=mood[,1:5]
y=mood[,6]
prior=Info_prior(x,y) #Laplace=0 as default
newdata=mood[1:200,1:5]
myresult=predict_naBa(prior,newdata,"raw")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.