configStats | R Documentation |
As part of the scoring cycle, the BNEngine
calculates the values of certain statistics of the student model.
This function sets up those statistics.
configStats(eng, statmat = data.frame())
eng |
The |
statmat |
A data frame containing the statistic descriptions, see details. |
A Statistic
is a functional that is applied to
the student model (sm
) of a
StudentRecord
. At the end of the evidence
processing cycle, the function updateStats
is called to
calculate new values for the specified statistics.
The statmat
argument should be a data.frame
with three
columns (all of mode character):
This column gives an identifier for the statistic used in the output message.
This column gives the name of a function (see
Statistic
for a list of possible values)
which calculates the statistic value.
This gives the name of a node in the competency model which is the focus of the statistic.
If the statmat
argument is not supplied, then a default value
based on the engine type is used. For the
BNEngineMongo
this data frame is taken from a
table in the database. For the BNEngineNDB
the
default statmat
is stored in a field in the engine.
The modified engine argument is returned.
Russell Almond
Almond, Mislevy, Steinberg, Yan and Williamson (2015). Bayesian Networks in Educational Assessment. Springer. Especially Chapter 13.
Classes:
BNEngine
, Statistic
updateStats
, announceStats
## Requires PNetica
library(RNetica) ## 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",
activeTest="EAActive.txt")
## Standard initialization methods.
configStats(eng,stattab)
stats <- eng$stats()
stopifnot(all(sapply(stats,StatName)==stattab$Name),
all(sapply(stats,function(s) s@fun)==stattab$Fun),
all(sapply(stats,function(s) s@node)==stattab$Node))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.