Description Usage Arguments Details Value References Examples
View source: R/calcDependence.R
Calculate dependence with a target variable
1 | calcDependence(dd, method="ncpc", ...)
|
dd |
An object of type DDDataSet |
method |
Algorithm to use. Valid values are:
|
... |
Extra parameters passed to backend functions Extra parameters for ncpc and ncpc*:
Extra parameters for hc, mmhc:
Extra parameters for hc-bic, hc-bde, mmhc-bic, mmhc-bde:
Extra parameters for iamb, fast.iamb, inter.iamb, mmpc:
Extra parameters for pc:
|
This function is a front-end convenience function to access predictions of direct dependence with a target variable by various Graphical Modelling algorithm.
Consider a set of variable X_1, ..., X_m and a target variable T. We say that that X_i is directly dependent with T if there is no other set of variable X_j, X_k, ... such that it renders X_i conditionally independent of T. In other words, X_i is the most immediate casual cause/consequence of T in the set of chosen variables.
Note that the above statement is different from that of classical feature selection for classification. A set of features obtained with feature selection have the property that a good classifier can be made based on them alone, while the above statement establishes statistical properties of variables. The set of variables with direct dependence might not be optimal for classification, since classification performance can be strongly influenced by false negatives (Friedman et al, 1997).
A list with elements:
obj - the resulting object, either of class DDGraph
for ncpc and ncpc* algorithms, or
of class bn
for bnlearn
algorithms, or
of class pcAlgo
for PC algorithm.
nbr - the variables with direct dependence (i.e. target node neighbourhood in the causal graph). For both ncpc and ncpc* includes variables with direct and joint dependence.
mb - the variables in Markov Blanket of target variable. Not applicable for ncpc algoritm. For ncpc* algorithm includes variables with direct, joint and conditional dependence.
labels - for ncpc and ncpc* contains the set of labels that are output of the algorithm.
Nir Friedman, Dan Geiger, and Moises Goldszmidt, "Bayesian Network Classifiers", Machine Learning 29 (November 1997): 131-163.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # load in the data for fly mesoderm
data(mesoBin)
# increase alpha to 0.1, suppress progress output
calcDependence(mesoBin$VM, "ncpc", alpha=0.05)
# run ncpc* with mutual information with shrinkage and minimal numbers of
# samples per conditioning set of 15
calcDependence(mesoBin$VM, "ncpc*", test.type="mi-sh", min.table.size=15)
# run PC algorithm using the G^2 test from pcalg package
calcDependence(mesoBin$VM, "pc", indepTest=pcalg::binCItest)
# run hill-climbing with BIC penalization and plot the resulting Bayesian Network
# NOTE: plotting requires the Rgraphviz package
if(require("Rgraphviz"))
calcDependence(mesoBin$VM, "hc-bic", make.plot=TRUE)
# continuous data example
data(mesoCont)
# run ncpc with linear correlation test and with maximal conditioning set of 3
res <- calcDependence(mesoCont$VM, "ncpc", max.set.size=3, test.type="cor")
# plot the resulting ddgraph with colours
if(require("Rgraphviz"))
plot(res$obj, col=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.