Skip to content

Commit 0810afa

Browse files
author
ralmond
committed
Big backfill & Doc cleanup.
1 parent d1f82ab commit 0810afa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1604
-255
lines changed

DESCRIPTION

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Package: Peanut
2-
Version: 0.7-1
3-
Date: 2019/10/21
2+
Version: 0.8-2
3+
Date: 2019/12/11
44
Title: Parameterized Bayesian Networks, Abstract Classes
55
Author: Russell Almond
66
Maintainer: Russell Almond <ralmond@fsu.edu>
7-
Depends: R (>= 3.0), CPTtools (>= 0.5), methods, shiny (>= 1.1), shinyjs, futile.logger
7+
Depends: R (>= 3.0), CPTtools (>= 0.5), methods, futile.logger
8+
Imports: shiny (>= 1.1), shinyjs, utils
89
Description: This provides support of learning conditional probability tables parameterized using CPTtools
910
License: Artistic-2.0
1011
URL: http://pluto.coe.fsu.edu/RNetica

NAMESPACE

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export(is.Pnet, as.Pnet, Pnet,
1515
BuildAllTables,
1616
is.Pnode, as.Pnode, Pnode, PnodeNet,
1717
PnodeQ, "PnodeQ<-",
18+
PnodeProbs, "PnodeProbs<-",
1819
PnodePriorWeight, "PnodePriorWeight<-",
20+
PnodePostWeight,
1921
PnodeRules, "PnodeRules<-",
2022
PnodeLink, "PnodeLink<-",
2123
PnodeLnAlphas, "PnodeLnAlphas<-",
@@ -52,6 +54,7 @@ S3method(PnodeParentTvals, default)
5254

5355

5456
## BN generics.
57+
exportClasses(Pnet,Pnode)
5558
export(PnodeName, "PnodeName<-",
5659
PnodeTitle, "PnodeTitle<-",
5760
PnodeDescription, "PnodeDescription<-",
@@ -70,7 +73,7 @@ export(PnodeName, "PnodeName<-",
7073
PnetDescription, "PnetDescription<-",
7174
PnetFindNode,
7275
PnetMakeStubNodes, PnetRemoveStubNodes,PnetAdjoin,
73-
PnetDetach,
76+
PnetDetach, PnetCompile,
7477
PnetSerialize, PnetUnserialize, unserializePnet
7578
)
7679
exportMethods(PnodeName, "PnodeName<-",
@@ -84,20 +87,22 @@ exportMethods(PnodeName, "PnodeName<-",
8487
PnodeStateBounds, "PnodeStateBounds<-",
8588
PnodeParents, "PnodeParents<-", PnodeParentNames, PnodeNumParents,
8689
isPnodeContinuous,
90+
PnodeEvidence,"PnodeEvidence<-",
8791
PnetName, "PnetName<-",
8892
PnetTitle, "PnetTitle<-",
8993
PnetHub, "PnetHub<-",
9094
PnetPathname, "PnetPathname<-",
9195
PnetDescription, "PnetDescription<-",
9296
PnetMakeStubNodes, PnetRemoveStubNodes,
93-
PnetAdjoin, PnetDetach,
97+
PnetAdjoin, PnetDetach, PnetCompile,
9498
PnetFindNode)
9599

96100
## Manifests
97101

98102
export(BuildNetManifest,BuildNodeManifest)
99103

100104
## Warehouses
105+
exportClasses(PnetWarehouse,PnodeWarehouse)
101106
export(ClearWarehouse,WarehouseManifest,"WarehouseManifest<-",
102107
WarehouseData,WarehouseSupply,WarehouseFetch,
103108
WarehouseMake,WarehouseFree, WarehouseUnpack,

R/BNgenerics.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
################################
2+
## Generic objects. These are implemented as class unions, so that
3+
## they can added to by implementing classes.
4+
5+
setClassUnion("Pnode","NULL")
6+
setClassUnion("Pnet","NULL")
7+
8+
19
###
210
## These are functions which it is pretty safe to assume that every
311
## Bayes net package has. We can put them here to make generics so
@@ -89,6 +97,14 @@ isPnodeContinuous <- function (node)
8997
UseMethod("isPnodeContinuous")
9098
setGeneric("isPnodeContinuous")
9199

100+
PnodeEvidence <- function (node)
101+
UseMethod("PnodeEvidence")
102+
setGeneric("PnodeEvidence")
103+
104+
"PnodeEvidence<-" <- function (node,value)
105+
UseMethod("PnodeEvidence<-")
106+
setGeneric("PnodeEvidence<-")
107+
92108

93109
#### Parents
94110

@@ -108,6 +124,8 @@ PnodeNumParents <- function (node)
108124
UseMethod("PnodeNumParents")
109125
setGeneric("PnodeNumParents")
110126

127+
128+
###############################################################
111129
## Pnets
112130
PnetName <- function (net)
113131
UseMethod("PnetName")
@@ -178,5 +196,9 @@ PnetUnserialize <- function (serial) {
178196
unserializePnet(factory,serial)
179197
}
180198

199+
PnetCompile <- function(net)
200+
UseMethod("PnetCompile")
201+
setGeneric("PnetCompile")
202+
181203

182204

R/Manifest.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ BuildNodeManifest <- function (Pnodelist) {
101101
if (isPnodeContinuous(nd)) {
102102
StateValue <- c(StateValue,rep(NA_real_,k))
103103
bnds <- PnodeStateBounds(nd)
104-
LowerBound <- c(UpperBound,bnds[,1L])
104+
LowerBound <- c(LowerBound,bnds[,1L])
105105
UpperBound <- c(UpperBound,bnds[,2L])
106106
} else {
107107
if (!is.null(PnodeStateValues(nd))) {

R/Pnets.R

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,21 @@ setGeneric("PnodePriorWeight")
262262
}
263263
setGeneric("PnodePriorWeight<-")
264264

265+
PnodePostWeight <- function (node) {
266+
UseMethod("PnodePostWeight")
267+
}
268+
setGeneric("PnodePostWeight")
269+
270+
PnodeProbs <- function (node) {
271+
UseMethod("PnodeProbs")
272+
}
273+
setGeneric("PnodeProbs")
274+
275+
"PnodeProbs<-" <- function (node,value) {
276+
UseMethod("PnodeProbs<-")
277+
}
278+
setGeneric("PnodeProbs<-")
279+
265280
PnodeParentTvals <- function (node) {
266281
UseMethod("PnodeParentTvals")
267282
}

R/QOmegaMat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ Omega2Pnet <- function(OmegaMat,pn,nodewarehouse,
844844
napar <- sapply(PnodeParentTvals(node),function(x) any(is.na(x)))
845845
if (any(napar)) {
846846
flog.error("Parents %s of node %s don't have levels set.",
847-
paste(parnames[napar],collapse=", "),nodename)
847+
paste(parnames[napar],collapse=", "),ndn)
848848
stop("Parent",paste(parnames[napar],collapse=", "),
849849
"of node", nodename, "don't have levels set.")
850850
}

R/Warehouses.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
setClassUnion("PnodeWarehouse","NULL")
2+
setClassUnion("PnetWarehouse","NULL")
13

24

35
ClearWarehouse <- function (warehouse)

R/shinyNode.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,6 @@ DPCGadget <- function(pnode, color="steelblue") {
767767
}
768768

769769
##########################################
770-
## Shiny breaks the show command
770+
## Shinyjs breaks the show command
771771

772772
show <- methods::show

TODO

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
* checking for missing documentation entries ... WARNING
22
Undocumented code objects:
3-
‘WarehouseInventory’ ‘WarehouseUnpack’
4-
‘flog.try’ ‘name’
5-
Undocumented S4 methods:
6-
generic 'WarehouseSupply' and siglist 'ANY'
7-
Functions or methods with usage in documentation object 'Pnet' but not in code:
8-
Pnet.ANY
9-
3+
PnodePostWeight ‘name’
104

5+
116
https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}
127

138
https://docs.google.com/spreadsheets/d/1UoIfFQn5TUwDBDWqxBEQxkwJbUHHjlo7WDCebvzx9j8/edit?usp=sharing

inst/auxdata/Mini-PP-Nodes.csv

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
"","Model","NodeName","ModelHub","NodeTitle","NodeDescription","NodeLabels","Continuous","Nstates","StateName","StateTitle","StateDescription","StateValue","LowerBound","UpperBound"
2-
"1","miniPP_CM","Physics","","Physics Understanding","General understanding of Newtonian mechanics.","pnodes,Proficiencies",FALSE,3,"High","Highest 1/3","Highest third of target population",0.967421566101701,NA,NA
2+
"1","miniPP_CM","Physics","","Physics Understanding","General understanding of Newtonian mechanics.","Proficiencies,pnodes",FALSE,3,"High","Highest 1/3","Highest third of target population",0.967421566101701,NA,NA
33
"2","miniPP_CM","Physics","","","","",NA,NA,"Medium","Middle 1/3","Middle Third of target Population",0,NA,NA
44
"3","miniPP_CM","Physics","","","","",NA,NA,"Low","Lowest 1/3","Lowest third of target population",-0.967421566101701,NA,NA
55
"4","miniPP_CM","IterativeD","","Use iterative design to solve a problem","Mass and GPE are directly related
6-
Height and GPE are directly related","pnodes,LowLevel,Proficiencies",FALSE,3,"High","","Complete Mastery",0.967421566101701,NA,NA
6+
Height and GPE are directly related","Proficiencies,pnodes,LowLevel",FALSE,3,"High","","Complete Mastery",0.967421566101701,NA,NA
77
"5","miniPP_CM","IterativeD","","","","",NA,NA,"Medium","","Partial Mastery",0,NA,NA
88
"6","miniPP_CM","IterativeD","","","","",NA,NA,"Low","","No Mastery",-0.967421566101701,NA,NA
9-
"7","miniPP_CM","EnergyTransfer","","Energy can Transfer","Energy can transfer from one object to another.","pnodes,LowLevel,Proficiencies",FALSE,3,"High","","Can use to solve difficult problems",0.967421566101701,NA,NA
9+
"7","miniPP_CM","EnergyTransfer","","Energy can Transfer","Energy can transfer from one object to another.","Proficiencies,pnodes,LowLevel",FALSE,3,"High","","Can use to solve difficult problems",0.967421566101701,NA,NA
1010
"8","miniPP_CM","EnergyTransfer","","","","",NA,NA,"Medium","","Can use to solve simple but not difficult problems",0,NA,NA
1111
"9","miniPP_CM","EnergyTransfer","","","","",NA,NA,"Low","","Can not solve simple problems.",-0.967421566101701,NA,NA
1212
"10","miniPP_CM","NTL","","Newton's Third Law","Force pairs act in opposite directions
13-
Force pairs have equal magnitudes","pnodes,LowLevel,Proficiencies",FALSE,3,"High","","",0.967421566101701,NA,NA
13+
Force pairs have equal magnitudes","Proficiencies,pnodes,LowLevel",FALSE,3,"High","","",0.967421566101701,NA,NA
1414
"11","miniPP_CM","NTL","","","","",NA,NA,"Medium","","",0,NA,NA
1515
"12","miniPP_CM","NTL","","","","",NA,NA,"Low","","",-0.967421566101701,NA,NA
1616
"13","miniPP_CM","POfMom","","Properties of momentum","Momentum is directly related to mass
1717
Momentum is directly related to velocity
18-
Momentum is parallel to velocity","pnodes,LowLevel,Proficiencies",FALSE,3,"High","","",0.967421566101701,NA,NA
18+
Momentum is parallel to velocity","Proficiencies,pnodes,LowLevel",FALSE,3,"High","","",0.967421566101701,NA,NA
1919
"14","miniPP_CM","POfMom","","","","",NA,NA,"Medium","","",0,NA,NA
2020
"15","miniPP_CM","POfMom","","","","",NA,NA,"Low","","",-0.967421566101701,NA,NA
2121
"Right","PPcompEM","CompensatoryObs","miniPP_CM","Compensatory Observable","A binary response which requires both parent variables for high probability of success.","onodes,Observables,pnodes",FALSE,2,"Right","","",NA,NA,NA
@@ -25,11 +25,11 @@ Momentum is parallel to velocity","pnodes,LowLevel,Proficiencies",FALSE,3,"High"
2525
"Full","PPtwostepEM","TwoStepObs","miniPP_CM","Partial Credit observable","A partial credit response where each step requires different inputs.","onodes,Observables,pnodes",FALSE,3,"Full","Complete Solution","",NA,NA,NA
2626
"Partial","PPtwostepEM","TwoStepObs","","","","",NA,NA,"Partial","First step but not second","",NA,NA,NA
2727
"None","PPtwostepEM","TwoStepObs","","","","",NA,NA,"None","No attempt of failed first step","",NA,NA,NA
28-
"one","PPdurAttEM","Attempts","miniPP_CM","Number of Attempts","The number of times level was started or restarted","onodes,Observables,pnodes",TRUE,4,"one","1","",NA,0.5,1.5
29-
"two","PPdurAttEM","Attempts","","","","",NA,NA,"two","2","",NA,1.5,2.5
30-
"three","PPdurAttEM","Attempts","","","","",NA,NA,"three","3","",NA,2.5,3.5
31-
"fourPlus","PPdurAttEM","Attempts","","","","",NA,NA,"fourPlus","4 or more","",NA,3.5,Inf
32-
"Q1","PPdurAttEM","Duration","miniPP_CM","Time spent on level","Total time spent on level less time spent on learning supports","onodes,Observables,pnodes",TRUE,4,"Q1","0–30.190","",NA,0,30.19
28+
"one","PPdurAttEM","Attempts","miniPP_CM","Number of Attempts","The number of times level was started or restarted","pnodes,onodes,Observables",TRUE,4,"one","1","",NA,0.1,1.1
29+
"two","PPdurAttEM","Attempts","","","","",NA,NA,"two","2","",NA,1.1,2.1
30+
"three","PPdurAttEM","Attempts","","","","",NA,NA,"three","3","",NA,2.1,3.1
31+
"fourPlus","PPdurAttEM","Attempts","","","","",NA,NA,"fourPlus","4 or more","",NA,3.1,Inf
32+
"Q1","PPdurAttEM","Duration","miniPP_CM","Time spent on level","Total time spent on level less time spent on learning supports","pnodes,onodes,Observables",TRUE,4,"Q1","0–30.190","",NA,0,30.19
3333
"Q2","PPdurAttEM","Duration","","","","",NA,NA,"Q2","30.190–67.037","",NA,30.19,67.037
3434
"Q3","PPdurAttEM","Duration","","","","",NA,NA,"Q3","67.037–154.893","",NA,67.037,154.893
3535
"Q4","PPdurAttEM","Duration","","","","",NA,NA,"Q4","154.893—Inf","",NA,154.893,Inf

0 commit comments

Comments
 (0)