Learn R Programming

D2C (version 1.2.1)

initialize,D2C-method: creation of a D2C object which preprocesses the list of DAGs and observations contained in sDAG and fits a Random Forest classifier

Description

creation of a D2C object which preprocesses the list of DAGs and observations contained in sDAG and fits a Random Forest classifier

Usage

"initialize"(.Object, sDAG, descr = new("D2C.descriptor"), verbose = TRUE, ratioMissingNode = 0, ratioEdges = 1, max.features = 20, goParallel = FALSE)

Arguments

.Object
: the D2C object
sDAG
: simulateDAG object
descr
: D2C.descriptor object containing the parameters of the descriptor
verbose
: if TRUE it prints the state of progress
ratioMissingNode
: percentage of existing nodes which are not considered. This is used to emulate latent variables.
ratioEdges
: percentage of existing edges which are added to the training set
max.features
: maximum number of features used by the Random Forest classifier randomForest. The features are selected by the importance returned by the function importance.
goParallel
: if TRUE it uses parallelism

References

Gianluca Bontempi, Maxime Flauder (2014) From dependency to causality: a machine learning approach. Under submission

Examples

Run this code
require(RBGL)
require(gRbase)
 require(foreach)
descr=new("D2C.descriptor")
descr.example<-new("D2C.descriptor",bivariate=FALSE,ns=3,acc=TRUE)
trainDAG<-new("simulatedDAG",NDAG=2, N=50,noNodes=10,
             functionType = "linear", seed=0,sdn=0.5)
example<-new("D2C",sDAG=trainDAG, descr=descr.example)

Run the code above in your browser using DataLab