readHistory {CPTtools} | R Documentation |
In running a typical Bayes net engine, as each piece of evidence comes in, updated marginal distributions for several variables are output. This function reads a such a log, expressed as a comma separated value file, and creates a data structure suitable for doing weight of evidence analyses.
readHistory(csvfile)
csvfile |
A name of a CSV file containing StatShop marginal distributions, one per row. Expects a column named "Item" from which the names are taken and "Result" which contains the values. |
This works with an excerpted log from a StatShop/ACED interaction. In
this case the Item column should contain the name of the item
presented at this iteration, possibly with an .xml
suffix. The
Results column should contain a probability vector of the form:
[High:0.527,Medium:0.447,Low:0.025]
. This function parses the
CSV file and creates a matrix with rows corresponding to the rows in
the CSV file and values from the probability vectors.
A matrix whose column names are taken from the probability vectors and
row names are taken from the Item field with the .xml
suffix removed.
Russell Almond
http://research.ets.org/~ralmond/StatShop/dataFormats.html
## Not run: allcorrect <- parseProbVec("CorrectSequence.csv") ## End(Not run)