library(rb4model)

This package aims to build an R package that elegantly performs data pre-processing in a fast and easy manner. With four separate functions that will come along with the rb4model package, users will have greater flexibility in handling many different types of datasets in the wild or those collected by them. With the rb4model package, users will be able to smoothly pre-process their data and have it ready for the machine learning model of their choice.

Handle Missing Values

  • This function will take in a dataframe and handle any missing values by either deleting the row, filling in the value with the average, or filling in the value with the last observation (the user will specify which method to use in the function argument).
  • This function will return a dataframe without missing values.

Here, we will replace missing values in the airquality dataset with the mean.

Feature Spliter

  • This function will take in a dataframe and split the data into numerical and categorical features.
  • This function will return two lists, one list containing the names of the numerical features and one list containing the names of the categorical features.

Here, we will split the mtcars dataset into numerical and categorical featrues.

Fit and Report

  • This function will take in data, fit a model, and calculate its training and validation scores.
  • This function will return the model’s training and validation scores.

Here we will fit the iris dataset to a general linear model and return its root mean squared error.

Forward Feature Selection

  • This function will take in data, fit a model, and perform forward feature selection.
  • This function will return a dataframe with only the selected features.

Here, we will perform forward feature selection on the iris dataset.