loadManifest: Loads the mainifest for the compentency and evidence models...

View source: R/EngineGears.R

loadManifestR Documentation

Loads the mainifest for the compentency and evidence models in the BNEngine

Description

This sets the manifest of networks used in the scoring engine. In particular, it sets the WarehouseManifest of the PnetWarehouse associated with a BNEngine.

Usage

loadManifest(eng, manifest = data.frame())

Arguments

eng

A BNEngine whose manifest is to be set.

manifest

A dataframe containing a network manifest (see BuildNetManifest). If missing, then the manifest will be retrieved from the database or other cached source.

Details

The BNEngine requires a proficiency or competency model (which is used to build student models) and a collection of evidence models (one for each scoring context) which are all expressed as Pnets. The manifest is basically a table of which evidence model networks go with which scoring contexts. The proficienty model usually serves as the hub in the hub-and-spoke framework. (In fact, if the profModel argument is not supplied when the BNEngine is built, the engine will look for a network which has no hub in the manifest.

In fact, the manifest is part of the PnetWarehouse which is a field of the engine. It should have the format associate with manifests described in WarehouseManifest. Note that the Bayes nets should have already been built, so the the warehouse should point to where they can be loaded from the filesystem on demand.

For the BNEngineMongo, the default manifest is located in a table in the database. If no manifest is supplied, then the manifest is read from the database. For the BNEngineNDB, the manifest must be specified manually when the engine is contructed (or when loadManifest is called).

Value

This function returns the engine argument.

Note

The loadManifest call is part of the initialization sequence for the BNEngine. However, if the manifest is loaded into the PnetWarehouse as it is built, it is really redundant.

Author(s)

Russell Almond

References

Almond, Mislevy, Steinberg, Yan and Williamson (2015). Bayesian Networks in Educational Assessment. Springer. Especially Chapter 13.

See Also

Classes: BNEngine, BNEngineMongo, BNEngineNDB, PnetWarehouse

Functions: WarehouseManifest, BuildNetManifest

Examples

## Not run: 
## Requires PNetica
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)

## Deliberately build warehouse without empty manifest.
Nethouse <- PNetica::BNWarehouse(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")

stopifnot(nrow(WarehouseManifest(eng$warehouse())) == 0L)

## Standard initialization methods.                     
loadManifest(eng,netman)
stopifnot(nrow(WarehouseManifest(eng$warehouse())) == 5L)


## End(Not run)

ralmond/EABN documentation built on Aug. 30, 2023, 12:52 p.m.