EABN-package: Evidence Accumulation Bayes Net Engine

EABN-packageR Documentation

Evidence Accumulation Bayes Net Engine

Description

Extracts observables from a sequence of events.

Details

The DESCRIPTION file: This package was not yet installed at build time.
Index: This package was not yet installed at build time.

The most important object in the package is the BNEngine which does most of the work of scoring. In particular, it takes a P4Message object containing observables, and a StudentRecord object and updates the student record.

It comes in two variants, BNEngineMongo which links to a Mongo database, and BNEngineNDB which processes raw messages without the database.

The functions doBuild builds the BNEngine, and the function doRunrun runs the engine on a queue of messages in the database. The function handleEvidence processes a single evidence message.

Author(s)

Russell Almond

Maintainer: Russell Almond <ralmond@fsu.edu>

References

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

See Also

Proc4 – Low level support for messaging. EIEvent – Evidence Accumulation which produces the input messages for EABN.

Examples

cat("This sample file is available in", system.file("conf/RunEABN.R",
   package="EABN"), "\n")

## Not run: 
library(R.utils)
library(EABN)
library(PNetica)
library(futile.logger)
library(jsonlite)

if (interactive()) {
  ## Edit these for the local application
  appStem <- "P4test"
  loglevel <- ""
  noprep <- FALSE
  override <- FALSE
} else {
  appStem <- cmdArg("app",NULL)
  if (is.null(app) || !grepl("^ecd://",app))
    stop("No app specified, use '--args app=ecd://...'")
  loglevel <- cmdArg("level","")
  noprep <- as.logical(cmdArg("noprep",FALSE))
  override <- as.logical(cmdArg("override",FALSE))
}

## This is the default location for INI files for Proc4 tools.
source("/usr/local/share/Proc4/EAini.R")


## Assumes the path config.dir (set in the INI file) contains a file
## config.json giving the location of the necessary configuration files
## and network files.
EA.config <- jsonlite::fromJSON(file.path(config.dir,"config.json"),FALSE)

app <- as.character(Proc4.config$apps[appStem])
if (length(app)==0L || any(app=="NULL")) {
  stop("Could not find app for ",appStem)
}
if (!(isTRUE(match(appStem,EA.config$appStem))) {
  stop("Configuration not set for app ",appStem)
}

## Start Netica
sess <- NeticaSession(LicenseKey=NeticaLicenseKey)
startSession(sess)

logfile <- (file.path(logpath, sub("<app>",appStem,EA.config$logname)))
if (interactive()) {
  flog.appender(appender.tee(logfile))
} else {
  flog.appender(appender.file(logfile))
}
flog.threshold(EA.config$logLevel)

## Load extensions.
for (ext in EA.config$extensions) {
  if (is.character(ext) && nchar(ext) > 0L) {
    if (file.exists(file.path(config.dir,ext))) {
      source(file.path(config.dir,ext))
    } else {
      flog.error("Can't find extension file 
    }
  }
}

## This will build the engine and run all messages in the QUEUE.


eng <- doRunrun(app,sess,EA.config,EAeng.local,config.dir,outdir,
                logfile=logfile,override=override,noprep=noprep)

## The engine object can now be used to process further messages or
## access the EABN database.


## End(Not run)


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