Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgovan committed Dec 3, 2017
1 parent c55e35a commit 49435ff
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 13,301 deletions.
Binary file added Rplot001.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inst/bn/figure/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion inst/bn/server.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#' @import bnlearn
#' @import deal
#' @import heatmaply
#' @import plotly
#' @import rintrojs
Expand Down
322 changes: 20 additions & 302 deletions inst/bn/tests/mytest-expected/003.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
"dendrogram": "both",
"editorIntro": 0,
"eval": 0,
"event": "CVP",
"evidence": "NORMAL",
"evidenceNode": "CVP",
"event": "A",
"evidence": "b",
"evidenceNode": "A",
"file": null,
"homeIntro": 0,
"inferenceIntro": 0,
"iss": 10,
"measuresIntro": 0,
"met": "mle",
"net": "3",
"Node": "CVP",
"net": "1",
"Node": "A",
"nodeMeasure": "mb",
"nodeNames": "CVP",
"nodeNames": "A",
"param": "barchart",
"parametersIntro": 0,
"rmd": "## Sample Code\nHere is some sample markdown to help illustrate the editor.\n\n### Get some sample data and show the first few values\n### Use `dat()` to get the active data set\n```{r}\ndat <- learning.test\nhead(dat)\n```\n\n### Learn the structure of the network\n```{r}\ndag <- bnlearn::cextend(bnlearn::gs(dat))\n```\n\n### Plot the force directed network\n```{r}\nnetworkData <- data.frame(bnlearn::arcs(dag))\n\nnetworkD3::simpleNetwork(\n networkData,\n Source = \"from\",\n Target = \"to\"\n)\n```\n\n### Print the network score\n```{r}\nbnlearn::score(dag, dat)\n```\n\n### Fit the model parameters and show the CPT for node A\n```{r}\nfit <- bnlearn::bn.fit(dag, dat)\nfit$A\n```\n\n### Plot the model parameters for node A\n```{r}\nbnlearn::bn.fit.barchart(fit[[\"A\"]])\n```\n\n### Get the Markov blanket for node A\n```{r}\nbnlearn::mb(dag, \"A\")\n```\n\n### Plot a d3 heatmap of the adjacency matrix\n```{r}\nheatmaply::heatmaply(\n bnlearn::amat(dag),\n grid_gap = 1,\n colors = blues9,\n dendrogram = \"both\",\n symm = TRUE,\n margins = c(100, 100, NA, 0),\n hide_colorbar = TRUE\n)\n````\n\n### Generate some random data from the network and show the first few values\n```{r}\nset.seed(1)\nsimData <- bnlearn::rbn(fit, n = 100, dat)\nhead(simData)\n```\n\n```{r}\n# Put your own code here...\n",
Expand Down Expand Up @@ -49,7 +49,7 @@
]
},
"condPlot": {
"src": "[image data sha1: f93e4aada0592598f2c90f8f2ab9da2c55118000]",
"src": "[image data sha1: 57c5bd3118ea27e30fc69d5cee2bffc8c8d0fabe]",
"width": 458,
"height": 400,
"coordmap": [
Expand Down Expand Up @@ -80,219 +80,27 @@
"x": {
"links": {
"source": [
24,
11,
31,
31,
4,
13,
13,
23,
28,
10,
26,
26,
21,
21,
21,
21,
19,
19,
19,
25,
17,
17,
17,
17,
6,
20,
20,
20,
30,
30,
3,
3,
3,
9,
12,
12,
12,
12,
8,
8,
29,
27,
0,
32,
32,
32,
32,
32,
33,
33,
35,
35,
34
0,
1,
2,
5
],
"target": [
20,
19,
2,
1,
2,
9,
12,
25,
31,
27,
18,
35,
17,
32,
33,
35,
24,
20,
30,
29,
26,
29,
33,
35,
34,
5,
16,
30,
4,
16,
31,
21,
0,
12,
3,
4,
14,
15,
3,
14,
15,
28,
28,
7,
26,
17,
27,
0,
33,
7,
18,
6,
34,
22
4
],
"value": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"colour": [
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
"#666",
Expand All @@ -302,74 +110,14 @@
},
"nodes": {
"name": [
"ACO2",
"APL",
"BP",
"CCHL",
"CO",
"CVP",
"DISC",
"ECO2",
"ERCA",
"ERLO",
"FIO2",
"HIST",
"HR",
"HRBP",
"HREK",
"HRSA",
"HYP",
"INT",
"KINK",
"LVF",
"LVV",
"MINV",
"MVS",
"PAP",
"PCWP",
"PMB",
"PRSS",
"PVS",
"SAO2",
"SHNT",
"STKV",
"TPR",
"VALV",
"VLNG",
"VMCH",
"VTUB"
"A",
"B",
"C",
"D",
"E",
"F"
],
"group": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
Expand All @@ -378,36 +126,6 @@
1
],
"nodesize": [
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
Expand Down Expand Up @@ -466,7 +184,7 @@
}
]
},
"score": "-218149.6"
"score": "-23873.13"
},
"export": {

Expand Down
Binary file modified inst/bn/tests/mytest-expected/003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 49435ff

Please sign in to comment.