The goal of SuperML is to provide sckit-learn’s fit,predict,transform standard way of building machine learning models in R. It is build on top of latest r-packages which provides optimized way of training machine learning models.


You can install latest stable cran version using (recommended):


You can install latest development version from github with:

# install.packages("devtools")


In superml, every machine learning algorithm is called as a trainer. Following is the list of trainers available as of today:

  • LMTrainer: used to train linear, logistic, ridge, lasso models
  • KNNTrainer: K-Nearest Neighbour Models
  • KMeansTrainer: KMeans Model
  • NBTrainer: Naive Baiyes Model
  • SVMTrainer: SVM Model
  • RFTrainer: Random Forest Model
  • XGBTrainer: XGBoost Model

In addition, there are other useful functions to support modeling tasks such as:

  • CountVectorizer: Create Bag of Words model
  • TfidfVectorizer: Create TF-IDF feature model
  • LabelEncoder: Convert categorical features to numeric
  • GridSearchCV: For hyperparameter optimization
  • RandomSearchCV: For hyperparameter optimization
  • kFoldMean: Target encoding (experimental)
  • smoothMean: Target encoding with smoothing


Any machine learning model can be trained using the following steps:

#> Loading required package: R6
rf <- RFTrainer$new(n_estimators = 100)
rf$fit(iris, "Species")
pred <- rf$predict(iris)