-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#' Add a hook to a tundraContainer. | ||
#' | ||
#' Hooks are useful for defining additional checks that should be | ||
#' performed prior to and during training and prediction. For example, | ||
#' one might want to issue a warning if the user is predicting on | ||
#' rows that were used for training, or a sanity check might be | ||
#' present prior to training to ensure a dependent variable is present. | ||
#' | ||
#' The following hooks are available. | ||
#' | ||
#' \enumerate{ | ||
#' \item{train_pre_munge}{This hook runs during a call to the | ||
#' container's \code{train} method, just prior to invoking the | ||
#' \code{munge_procedure} to clean up the dataset. It could be | ||
#' useful for defining pre-conditions on the dataset to ensure | ||
#' it can be munged successfully.} | ||
#' \item{train_post_munge}{This hook runs during a call to the | ||
#' container's \code{train} method, just after invoking the | ||
#' \code{munge_procedure} to clean up the dataset. It could be | ||
#' useful for defining post-conditions on the dataset to ensure | ||
#' it was munged successfully.} | ||
#' \item{train_finalize}{This hook runs just after the \code{train} | ||
#' method calls the \code{train_function}. It could be used to | ||
#' verify presence or validate properties of the trained model.} | ||
#' \item{predict_pre_munge}{This hook runs during a call to the | ||
#' container's \code{predict} method, just prior to invoking the | ||
#' \code{munge_procedure} to clean up the dataset. It could be | ||
#' useful for defining pre-conditions on the dataset to ensure | ||
#' it can be munged successfully.} | ||
#' \item{predict_post_munge}{This hook runs during a call to the | ||
#' container's \code{predict} method, just after invoking the | ||
#' \code{munge_procedure} to clean up the dataset. It could be | ||
#' useful for defining post-conditions on the dataset to ensure | ||
#' it was munged successfully.} | ||
#' } | ||
#' | ||
#' Each hook will be provided the \code{tundraContainer} as input | ||
#' (unless it has no arguments, in which case it will simply be called). | ||
#' | ||
#' @param hook_name character. The hook to run. Must be one of the available | ||
#' hooks. | ||
run_hooks <- function(hook_name) { | ||
|
||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/hooks.R | ||
\name{run_hooks} | ||
\alias{run_hooks} | ||
\title{Add a hook to a tundraContainer.} | ||
\usage{ | ||
run_hooks(hook_name) | ||
} | ||
\arguments{ | ||
\item{hook_name}{character. The hook to run. Must be one of the available | ||
hooks.} | ||
} | ||
\description{ | ||
Hooks are useful for defining additional checks that should be | ||
performed prior to and during training and prediction. For example, | ||
one might want to issue a warning if the user is predicting on | ||
rows that were used for training, or a sanity check might be | ||
present prior to training to ensure a dependent variable is present. | ||
} | ||
\details{ | ||
The following hooks are available. | ||
|
||
\enumerate{ | ||
\item{train_pre_munge}{This hook runs during a call to the | ||
container's \code{train} method, just prior to invoking the | ||
\code{munge_procedure} to clean up the dataset. It could be | ||
useful for defining pre-conditions on the dataset to ensure | ||
it can be munged successfully.} | ||
\item{train_post_munge}{This hook runs during a call to the | ||
container's \code{train} method, just after invoking the | ||
\code{munge_procedure} to clean up the dataset. It could be | ||
useful for defining post-conditions on the dataset to ensure | ||
it was munged successfully.} | ||
\item{train_finalize}{This hook runs just after the \code{train} | ||
method calls the \code{train_function}. It could be used to | ||
verify presence or validate properties of the trained model.} | ||
\item{predict_pre_munge}{This hook runs during a call to the | ||
container's \code{predict} method, just prior to invoking the | ||
\code{munge_procedure} to clean up the dataset. It could be | ||
useful for defining pre-conditions on the dataset to ensure | ||
it can be munged successfully.} | ||
\item{predict_post_munge}{This hook runs during a call to the | ||
container's \code{predict} method, just after invoking the | ||
\code{munge_procedure} to clean up the dataset. It could be | ||
useful for defining post-conditions on the dataset to ensure | ||
it was munged successfully.} | ||
} | ||
|
||
Each hook will be provided the \code{tundraContainer} as input | ||
(unless it has no arguments, in which case it will simply be called). | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
context("hooks") |