predict.groupbn: predict.groupbn

Description Usage Arguments Value Author(s) Examples

View source: R/adaptive_refinement_help.R

Description

Predict the target variable from a group Bayesian network

Usage

1
2
3
## S3 method for class 'groupbn'
predict(object, X.quanti, X.quali, rename.level=FALSE, return.data=FALSE,
new.fit=FALSE, debug=FALSE, ...)

Arguments

object

An object of class groupbn generated by the functions groupbn or groupbn_refinement

X.quanti

quantitative variables

X.quali

qualitative variables

rename.level

a boolean; if TRUE, all levels of categorical variables are renamed by integers. Default is FALSE.

return.data

a boolean; if TRUE, a list with predictions and group.data is returned instead of only predicitions. Default is FALSE.

new.fit

a boolean; if TRUE, the parameters are newly fit using the test data.

debug

a boolean, if TRUE, debugging messages are printed

...

further arguments

Value

Returns a dataframe with a column of predictions and a column of the target data. If the target is discrete, class probabilities are returned. Otherwise continuous scores are returned. If return.data is TRUE, additionally the transformed group data are returned.

Author(s)

Ann-Kristin Becker

Examples

1
2
3
4
5
6
7
8
#load example data
data(wine)
wine.test<-wine[wine$Soil%in%c("Reference", "Env1"),1:29]
wine.test$Soil<-factor(wine.test$Soil)
levels(wine.test$Soil)<-c("0", "1")

data(wine.groupbn.refined)
predict(wine.groupbn.refined, X.quanti=wine.test[,3:29], X.quali=wine.test[,1:2])

GroupBN documentation built on March 7, 2021, 5:06 p.m.