updateSM | R Documentation |
This function is the core of the EABN
algorithm. It finds and
attaches the evidence model to the student model, enters the findings
from the evidence message, and then detaches the evidence model,
leaving the student model updated.
updateSM(eng, rec, evidMess, debug = 0)
eng |
The |
rec |
The |
evidMess |
The |
debug |
An integer describing how much debugging to do. If set
to a number greater than 1, it will issue a call to
|
The update algorithm performs the following step:
Finds the evidence model by name according to the
context
field of the EvidenceSet
. See
WarehouseSupply
.
Adjoins the sm
of the student record with the
evidence model and compiles the modified network. See
PnetAdjoin
and
PnetCompile
.
Loops over the observables
in the evidence set,
if they correspond to nodes in the evidence model, then
instantiate their values using
PnodeEvidence
.
Detatch the evidence model and recompile the network. See
PnetDetach
.
The updated student record is returned.
Russell Almond
Almond, Mislevy, Steinberg, Yan and Williamson (2015). Bayesian Networks in Educational Assessment. Springer. Especially Chapters 5 and 13.
Classes:
BNEngine
, PnetWarehouse
,
StudentRecord
, EvidenceSet
,
Pnet
Functions in EABN:
accumulateEvidence
, updateHist
,
updateStats
, getRecordForUser
Peanut Functions:
WarehouseSupply
,
PnetAdjoin
, PnetCompile
,
PnetDetach
, PnodeEvidence
## Not run:
## Requires Netica
library(PNetica) ## Must load to setup Netica DLL
app <- "ecd://epls.coe.fsu.edu/EITest"
sess <- RNetica::NeticaSession()
RNetica::startSession(sess)
config.dir <- file.path(library(help="Peanut")$path, "auxdata")
net.dir <- file.path(library(help="PNetica")$path,"testnets")
netman <- read.csv(file.path(config.dir, "Mini-PP-Nets.csv"),
row.names=1, stringsAsFactors=FALSE)
stattab <- read.csv(file.path(config.dir, "Mini-PP-Statistics.csv"),
as.is=TRUE)
Nethouse <- PNetica::BNWarehouse(netman,session=sess,
address=net.dir)
cl <- new("CaptureListener")
listeners <- list("cl"=cl)
ls <- ListenerSet(sender= paste("EAEngine[",app,"]"),
db=MongoDB(noMongo=TRUE), listeners=listeners)
eng <- newBNEngineNDB(app=app,warehouse=Nethouse,
listenerSet=ls,manifest=netman,
profModel="miniPP_CM",
histNodes="Physics",
statmat=stattab,
activeTest="EAActive.txt")
## Standard initialization methods.
loadManifest(eng,netman)
eng$setHistNodes("Physics")
configStats(eng,stattab)
setupDefaultSR(eng)
sr1 <- getRecordForUser(eng,"S1")
PnetCompile(sm(sr1))
eap1 <- PnodeEAP(sm(sr1),PnetFindNode(sm(sr1),"Physics"))
e1 <- EvidenceSet(uid="S1",app="Test",context="PPcompEM",
obs=list("CompensatoryObs"="Right"))
sr1a <- updateSM(eng,sr1,e1)
eap1a <- PnodeEAP(sm(sr1),PnetFindNode(sm(sr1),"Physics"))
## This should have changed.
stopifnot(abs(eap1-eap1a) > .001)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.