ML.Base.Rd
Base class for any machine learning model. Extend this class if you want to create a new machine learning model.
ML.Base
An object of class R6ClassGenerator
of length 24.
initialize()
Method used to create object of this class.
process(X_mat, Y_vals, X_mat_test, Y_vals_test)
<<description>> @param X_mat @param Y_vals @param X_mat_test @param Y_vals_test
perform_prediction(...)
Method to perform a prediction using the current machine learning model.
Note that this function is for testing purposes only. This function
calls the private do.predict
function. Each ML.Base model should
have a private do.predict
function, which is called by the
condensier package. The params for this private function are described
below.
@param X_mat matrix a matrix of X variables / independent variables to
do the prediction with.
@param m.fit fitted machine learning model. The actual model (NOT A
ML.BASE MODEL) to run the prediction from.
@return vector the predicted probabilities from the provided m.fit model.
perform_fit(...)
Method to fit the current machine learning model. Note that this
function is for testing purposes only. This function calls the private
do.fit
function. Each ML.Base model should have a private
do.fit
function, which is called by the condensier package. The
params for this private function are described below.
@param X_mat matrix a matrix of X values / independent variables
@param Y_vals vector a vector with the dependent variable
@return a fitted instance of the actual machine learning model
perform_update(...)
Method to perform an update of the provided machine learning model.
Note that this function is for testing purposes only. This function
calls the private do.update
function. Each online ML.Base model
should have a private do.update
function, which is called by the
condensier package. The params for this private function are described
below.
@param X_mat matrix a matrix of X variables / independent variables to
do the prediction with.
@param Y_vals vector a vector with the dependent variable
@param m.fit fitted machine learning model. The actual model (NOT A
ML.BASE MODEL) to perform the update on.
@return an updated instance of the actual machine learning model
create_formula(X, Y='Y')
Small helper function to create a formula notation of a dependent variable ~ independent variables. Useful when the submodel accepts this format for specifying a model and the outcome Y. @param X vector a vector of X variables / independent variable names @param Y string (default = "Y") the name of the dependent variable