plot.idgraph: Plots interdependencies graph

Description Usage Arguments Examples

View source: R/rmcfs.plot.R

Description

Invokes plot.igraph with predefined parameters to visualize interdependencies graph (ID-Graph). Standard plot function with custom parameters may be used instead of this one.

Usage

1
2
3
4
5
  ## S3 method for class 'idgraph'
plot(x, 
          label_dist = 0.5, 
          color = 'darkred',
          cex = 1, ...)

Arguments

x

idgraph/igraph S3 object representing feature interdependencies. This object is produced by build.idgraph function.

label_dist

space between the node's label and the corresponding node in the plot.

color

it defines color of the graph nodes.

cex

size of fonts.

...

additional plotting parameters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  ## Not run: ###dontrunbegin
  
  # create input data
  adata <- artificial.data(rnd_features = 10)
  showme(adata)
  
  # Parametrize and run MCFS-ID procedure
  result <- mcfs(class~., adata, cutoffPermutations = 0, featureFreq = 50,
                  finalCV = FALSE, finalRuleset = FALSE, threadsNumber = 2)
  
  # build interdependencies graph for top 6 features 
  # and top 12 interdependencies and plot all nodes
  gid <- build.idgraph(result, size = 6, size_ID = 12, orphan_nodes = TRUE)
  plot(gid, label_dist = 1)
  
  
## End(Not run)###dontrunend

Example output

Loading required package: rJava

  ########################
  ##   rmcfs   1.2.15   ##
  ########################
  If used please cite the following paper: 
  M. Draminski, J. Koronacki (2018), 
  rmcfs: An R Package for Monte Carlo Feature Selection and Interdependency Discovery,
  Journal of Statistical Software, vol 85(12), 1-28, doi:10.18637/jss.v085.i12.
          X1        X2         X3        X4         X5         X6        X7
1  0.3930107 0.3663493 0.38472302 0.5231210 0.41198267 0.76316701 0.7403338
2  0.8477112 0.8862161 0.43740693 0.9837048 0.25369210 0.94306892 0.2809859
3  0.3980598 0.8071308 0.15242067 0.1138398 0.91578190 0.59179029 0.7064991
4  0.8443938 0.7690093 0.03827253 0.3638340 0.80776492 0.23910017 0.9315151
5  0.5370111 0.8292374 0.75562139 0.3587937 0.29421959 0.00236669 0.7572942
6  0.4070033 0.6478332 0.44078957 0.5373605 0.59909905 0.71363226 0.4231788
7  0.3533752 0.9916727 0.87594382 0.9287339 0.28275152 0.34097983 0.9032967
8  0.7734430 0.1969377 0.46840625 0.4158277 0.02713330 0.76381899 0.1317639
9  0.3626167 0.4714013 0.99050051 0.7332733 0.03945014 0.89841888 0.3601390
10 0.1374891 0.4289984 0.52236197 0.7735007 0.91963210 0.58737566 0.9399527
          X8         X9         X10
1  0.3771495 0.95244865 0.637382733
2  0.3240378 0.46141117 0.834912962
3  0.7286271 0.08268236 0.931144820
4  0.1606327 0.86374901 0.712248333
5  0.9766857 0.59797595 0.554702510
6  0.5707007 0.95430054 0.574245517
7  0.5775714 0.25045984 0.914132439
8  0.2733582 0.99839912 0.007631675
9  0.8197607 0.07040937 0.037980088
10 0.2716991 0.97478223 0.105096398


            X7         X8        X9        X10 A1 A2 B1 B2 C1 C2 class
60 0.664640874 0.03549135 0.2912184 0.71342019  0  0  0  0  0  0     B
61 0.257072543 0.95822999 0.4837183 0.46706456  0  0  0  0  0  0     C
62 0.424140241 0.27672091 0.5769849 0.05890492  0  0  0  0  C  C     C
63 0.740464086 0.06420468 0.3993345 0.77116243  0  0  0  0  C  C     C
64 0.915609306 0.95802624 0.1607511 0.07035358  0  0  0  0  C  C     C
65 0.347891173 0.56451597 0.4230502 0.12820831  0  0  0  0  0  0     C
66 0.431517157 0.29369966 0.3349596 0.63414046  0  0  0  0  0  0     C
67 0.009327838 0.56759436 0.9663640 0.17126916  0  0  0  0  C  C     C
68 0.763069531 0.64192371 0.5744504 0.62816292  0  0  0  0  0  0     C
69 0.560870141 0.66840742 0.5962220 0.78485115  0  0  0  0  C  C     C
70 0.996192478 0.47594241 0.6291487 0.37286428  0  0  0  0  C  C     C
class: 'data.frame' size: 70 x 17Checking input data...
Exporting params...
Exporting input data...
Running MCFS-ID...
*****************************************
********          dmLab           *******
***     ver. 2.2.1     2016.10.27     ***
*****************************************
Created by Michal Draminski [mdramins@ipipan.waw.pl]
http://www.ipipan.eu/staff/m.draminski/
Polish Academy of Sciences - Institute of Computer Science
**************************************************************************
'MCFS-ID' and 'ADX' are developed by Michal Draminski
'rmcfs' developed by Michal Draminski & Julian Zubek
'SLIQ' developed by Mariusz Gromada
**************************************************************************
If you want to use dmLab or 'MCFS-ID' in your work, please cite the paper:
M.Draminski, A.Rada-Iglesias, S.Enroth, C.Wadelius, J. Koronacki, J.Komorowski
'Monte Carlo feature selection for supervised classification', BIOINFORMATICS 24(1): 110-117 (2008)
**************************************************************************

Warning! Value of cutoffPermutations = 0 and cutoffMethod = 'permutations'. Using cutoffMethod = 'mean'.

**************************
*** MCFS-ID Experiment ***
**************************
Loading data: 'input.adx'...
attributes: 17 events: 70
Data loaded.
Nominal target detected - using J48 model.
MCFS-ID param: ID-Graph is ON
MCFS-ID param:  balance classes is AUTO
Classes = [B, C, A], Sizes = [20, 10, 40], classSizeRatio = 0.25, balanceValue = 1.0
Starting MCFS-ID Procedure: projectionSize(m) = 4, projections(s) = 200, splits(t) = 5
Start time: Sat Oct 05 20:32:21 UTC 2019
Running: 2 threads.
10% 15% 20% 25% 30% 35% 40% 45% 50% 55% 60% 65% 70% 75% 80% 85% 90% 95% 100% 
All 2 threads are finished.
1000 trees built in 1.8 s.
Confusion Matrix
			predicted
class	B	C	A	other
B	4932.0	315.0	1823.0	0.0
C	877.0	1689.0	1474.0	0.0
A	546.0	223.0	13371.0	0.0
other	0.0	0.0	0.0	0.0


Accuracy = 0.7917
WeightedAccuracy = 0.6870
True Positive Rate
	B: 0.6975
	C: 0.4180
	A: 0.9456
False Positive Rate
	B: 0.0782
	C: 0.0253
	A: 0.2967

Minimal (based on linear regression angle) RI = 0.0293235
Minimal (based on k-means clustering) RI = 0.4564096
Minimal important (mean based on cutoff methods) RI = 0.0293235
Size of important (mean based on cutoff methods) attributes set = 6

*** Saving filtered data ***
*** Calculations for input data: 'input' are finished! Processing time: 1.9 s. ***
Reading results...
Done.
Selected 6 nodes and 12 edges.

rmcfs documentation built on Sept. 18, 2021, 5:07 p.m.

Related to plot.idgraph in rmcfs...