7 Developer Notes

This section provides information for developers on the structure of the code, as well as any package and function dependencies.

7.1 Internal Functions

  • internalNBC: execute and return the details of the naive bayes classifier algorithm
  • internalCheckNBC: checks the nbc() function arguments
  • internalCheckNBCSummary: checks the summary.nbc() function arguments
  • internalGetCSMFMaxError: calculates the CSMF maximum error given the observed cases
  • internalGetCSMFAcc: calculates the CSMF accuracy given the predicted and observed cases of any length
    • Dependencies: internalGetCSMFMaxError()
  • internalGetCauseMetrics: creates a dataframe of particular metrics for each cause
  • internalGetMetrics: creates a vector of overall metrics given the observed and predicted cases
    • Dependencies:internalGetCSMFMaxError(), internalGetCSMFAcc()
  • internalSubAsRest: substitute a target value for the rest of the values by their distribution per column
    • Dependencies: internalRoundFixedSum()
  • internalRoundFixedSum: round a vector of values to whole numbers while preserving their sum

7.2 External Functions

  • nbc: main function for running the naive bayes classifier
    • Dependencies: internalCheckNBC(), internalNBC()
  • summary.nbc: consumes output from nbc() to calculate informative metrics
    • Dependencies: internalCheckNBCSummary(), internalGetCauseMetrics(), internalGetMetrics(), internalGetCSMFMaxError(), internalGetCSMFAcc()
  • print.nbc_summary: consumes output from summary.nbc() to print a message of the top causes
    • Dependencies: summary.nbc(), nbc()
  • plot.nbc: consumes output from nbc() to plot the top causes
    • Dependencies: summary.nbc(), nbc()
  • nbc4vaIO: file input and output for the main package functions
    • Dependencies: summary.nbc(), nbc()
  • nbc4vaGUI: graphical user interface to run the main package functions
    • Dependencies: nbc4vaIO()
    • Required Packages: shiny
  • csmf.nbc: consumes output from nbc() to get the predicted csmfs
    • Dependencies: nbc(), summary.nbc()
  • topCOD.nbc: consumes output from nbc() to get the top predictions
    • Dependencies: nbc()

7.3 Extra Functions

  • ova2nbc: consumes arguments specified in the openVA package to get a modified nbc object