Build Machine Learning Models Like Using Python's Scikit-Learn Library in R

The idea is to provide a standard interface to users who use both R and Python for building machine learning models. This package provides a scikit-learn's fit, predict interface to train machine learning models in R.

CRAN status Build Status Downloads

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 superml from github with:



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
  • smoothMean: Target encoding


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

# random forest
rf <- RFTrainer$new(n_estimators = 100)
rf$fit(iris, "Species")
pred <- rf$predict(iris)


The documentation can be found here: SuperML Documentation

Contributions & Support

SuperML is my ambitious effort to help people train machine learning models in R as easily as they do in python. I encourage you to use this library, post bugs and feature suggestions in the issues above.


superml 0.4.0

  • Fixed svm error. Replaced liquidSVM with e1071 R package.

superml 0.3.0

  • Moved some imports to suggests

superml 0.2.0

  • Added new trainers: SVM, NaiveBayes
  • Renamed gridsearch, randomsearch trainers to CV
  • Fixed documentation

superml 0.1.0

  • Added a file to track changes to the package.
  • Fixed travis-ci integration

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.5.3 by Manish Saraswat, 2 years ago

Report a bug at

Browse source code at

Authors: Manish Saraswat [aut, cre]

Documentation:   PDF Manual  

GPL-3 | file LICENSE license

Imports data.table, Rcpp, assertthat, Metrics

Depends on R6

Suggests knitr, rlang, testthat, rmarkdown, naivebayes, ClusterR, FNN, ranger, caret, xgboost, glmnet, e1071

Linking to Rcpp, BH, RcppArmadillo

See at CRAN