gen_emis | R Documentation |
Generating the inital emission probability distribution of the covariates in TAN structure.
gen_emis(net, observation, sym)
net |
Object of type 'bn' provided as output by bnlearnmodel2network showing the TAN structure between target variable and covariates. |
observation |
Dataframe containing the discritized character values of only covariates at each node. Column names of dataframe should be same as the covariate names. Missing values should be denoted by "NA". |
sym |
Character vector of possible values of target variable |
Inital emission probability distribution of the covariates in TAN structure
library(bnlearn) bnet = model2network("[A][C|A:B][D|A:C][B|A]") #A is the target variable while #B, C and D are covariates obsvA=data.frame(list(B=c("L","H","H","L","L"),C=c("H","H","L","L","H"),D=c("L","L","L","H","H"))) target_value= c("P","N") prob= gen_emis(net=bnet,observation=obsvA,sym=target_value)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.