GADAG_Analyze: Analyze GADAG results.

Description Usage Arguments Details Value Author(s) Examples

View source: R/GADAG_Analyze.R

Description

Function to Analyze GADAG results.

Usage

1
2
3
GADAG_Analyze(Results, G = NULL, X = NULL, threshold = 0.1,
  plot.control = list(plot.graph = FALSE, plot.evol = FALSE, plot.png =
  FALSE))

Arguments

Results

Outputs from GADAG_Run() function.

G

(optional) Adjacency matrix corresponding to the true DAG (pxp matrix).

X

(optional) Design matrix with samples (n) in rows and variables (p) in columns.

threshold

Thresholding value for the edges.

plot.control

A list containing parameters to control the produced graph outputs (return.level has to be turned to 1 in the main code beforehand):

  • plot.graph If TRUE, generates the figures with the actual and estimated graphs,

  • plot.evol If TRUE, generates the figures showing the evolution of the genetic algorithm (fitness value, Shannon entropy and best node ordering),

  • plot.png If TRUE, saves the figures in .png.

Details

This function returns as primary outputs the performances of the estimation graph procedure in terms of TP, FP, FN, TN, precision and recall, obtained by comparing the estimated graph with the true one (if known and provided). If specified (plot.graph, plot.evol), the user can plot both the estimated graph and the true DAG (if known and provided) and the evolution of the algorithm. This generates three figures: the first one represents the evolution of the fitness value (best fitness in red, averaged population fitness and quantiles across the iterations), the second onen, the evolution of the Shannon entropy of each node across the iterations, the third one, the best node ordering (permutation that minimizes the fitness) across the iterations.

Value

A vector containing the scores of precision, recall, number of false positives (FP), false negatives (FN), true positives (TP), true negatives (TN) and mean squared error (only if G and X are provided).

Author(s)

Magali Champion, Victor Picheny and Matthieu Vignes

Examples

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 #############################################################
 # Loading toy data
 #############################################################
 data(toy_data)
 # toy_data is a list of two matrices corresponding to a "star"
 # DAG (node 1 activates all other nodes):
 # - toy_data$X is a 100x10 design matrix
 # - toy_data$G is the 10x10 adjacency matrix (ground trough)

 ########################################################
 # Evaluating GADAG Results
 ########################################################
 # simple run, where you only get the precision, recall, number
 # of false positives, true positives, false negatives, true negatives
 # and mean squared error of the estimated graph

 # run GADAG with the predefined parameters
 GADAG_results <- GADAG_Run(X=toy_data$X, lambda=0.1)

 # analyze the results
 GADAG_analysis <- GADAG_Analyze(GADAG_results, G=toy_data$G, X=toy_data$X)
 print(GADAG_analysis) # here are the results

 # more complex run, where you want to have some details about the procedure
 ## Not run: 
 # run GADAG with return.level set to 1 beforehand
 GADAG_results <- GADAG_Run(X=toy_data$X, lambda=0.1,return.level=1)

 # print the evolution of the algorithm
 plot.evol <- TRUE
 GADAG_analysis <- GADAG_Analyze(GADAG_results, G=toy_data$G, X=toy_data$X,
          plot.control = list(plot.evol=TRUE))

 # in addition, print the estimated and the true graph
 plot.graph <- TRUE
 GADAG_analysis <- GADAG_Analyze(GADAG_results, G=toy_data$G, X=toy_data$X,
          plot.control = list(plot.evol=plot.evol, plot.graph= plot.graph))

 # now save the results in .png, but only for the graphs
 plot.png <- TRUE
 GADAG_analysis <- GADAG_Analyze(GADAG_results, G=toy_data$G, X=toy_data$X,
          plot.control = list(plot.graph= plot.graph, plot.png = plot.png))

 # in case you don't know the true DAG, you can't really know how good the
 # estimation is. You can't compute the precision, recall, MSE but you can
 # still plot the estimated graph and see the evolution of the algorithm
 plot.graph <- plot.evol <- TRUE
 plot.png <- FALSE
 GADAG_analysis <- GADAG_Analyze(GADAG_results, X=toy_data$X,
          plot.control = list(plot.graph= plot.graph, plot.evol = plot.evol))
 
## End(Not run)

GADAG documentation built on May 2, 2019, 3:25 p.m.