Learn R Programming

⚠️There's a newer version (0.7.7) of this package.Take me there.

fastml: Fast Machine Learning Model Training and Evaluation

fastml is a streamlined R package designed to simplify the training, evaluation, and comparison of multiple machine learning models. It offers comprehensive data preprocessing, supports a wide range of algorithms with hyperparameter tuning, and provides performance metrics alongside visualization tools to facilitate efficient and effective machine learning workflows.

Features

  • Comprehensive Data Preprocessing: Handle missing values, encode categorical variables, and apply various scaling methods with minimal code.
  • Support for Multiple Algorithms: Train a wide array of machine learning models including XGBoost, Random Forest, SVMs, KNN, Neural Networks, and more.
  • Hyperparameter Tuning: Customize and automate hyperparameter tuning for each algorithm to optimize model performance.
  • Performance Evaluation: Evaluate models using metrics like Accuracy, Kappa, Sensitivity, Specificity, Precision, F1 Score, and ROC AUC.
  • Visualization Tools: Generate comparison plots to visualize and compare the performance of different models effortlessly.
  • Easy Integration: Designed to integrate seamlessly into your existing R workflows with intuitive function interfaces.

Installation

From CRAN

You can install the latest stable version of fastml from CRAN using:

install.packages("fastml")

You can install all dependencies (additional models) using:

# install all dependencies - recommended
install.packages("fastml", dependencies = TRUE)

From GitHub

For the development version, install directly from GitHub using the devtools package:

# Install devtools if you haven't already
install.packages("devtools")

# Install fastml from GitHub
devtools::install_github("selcukorkmaz/fastml")

Quick Start

Here's a simple workflow to get you started with fastml:

library(fastml)

# Example dataset
data(iris)
iris <- iris[iris$Species != "setosa", ]  # Binary classification
iris$Species <- factor(iris$Species)

# Train models
model <- fastml(
  data = iris,
  label = "Species"
)

# View model summary
summary(model)

Tuning Strategies

fastml supports both grid search and Bayesian optimization through the tuning_strategy argument. Use "grid" for a regular parameter grid or "bayes" for Bayesian hyperparameter search. The tuning_iterations parameter controls the number of iterations only when tuning_strategy = "bayes" and is ignored otherwise.

Explainability

fastexplain() provides several ways to understand trained models. Set the method argument to choose an approach:

# LIME explanations
explain_lime(model)

# ICE curves
fastexplain(model, method = "ice", features = "Sepal.Length")

# Accumulated Local Effects
fastexplain(model, method = "ale", features = "Sepal.Length")

# Surrogate tree
fastexplain(model, method = "surrogate")

# Interaction strength
fastexplain(model, method = "interaction")

# Counterfactual explanation for a single observation
fastexplain(model, method = "counterfactual", observation = iris[1, ])

Copy Link

Version

Install

install.packages('fastml')

Monthly Downloads

477

Version

0.7.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Selcuk Korkmaz

Last Published

October 29th, 2025

Functions in fastml (0.7.0)

determine_round_digits

Determine rounding digits for time horizons
fastexplain

Explain a fastml model using various techniques
extract_survreg_components

Extract survreg Linear Predictor and Scale
compute_survreg_matrix

Compute Survival Matrix from survreg Model
compute_rmst_difference

Compute Difference in Restricted Mean Survival Time (RMST)
fastexplore

Explore and Summarize a Dataset Quickly
framingham

Framingham Heart Study Data
get_best_model_idx

Get Best Model Indices by Metric and Group
flatten_and_rename_models

Flatten and Rename Models
fastml_normalize_survival_status

Internal helpers for survival-specific preprocessing
plot.fastml

Plot Methods for fastml Objects
map_brier_values

Map Brier Curve Values to Specific Horizons
fastml

Fast Machine Learning Function
get_default_engine

Get Default Engine
get_default_params

Get Default Parameters for an Algorithm
explain_dalex

Generate DALEX explanations for a fastml model
get_best_model_names

Get Best Model Names
explain_lime

Generate LIME explanations for a fastml model
get_default_tune_params

Get Default Tuning Parameters
train_models

Train Specified Machine Learning Algorithms on the Training Data
get_engine_names

Get Engine Names from Model Workflows
surrogate_tree

Fit a surrogate decision tree for a fastml model
load_model

Load Model Function
get_best_workflows

Get Best Workflows
predict_survival

Predict survival probabilities from a survival model
interaction_strength

Compute feature interaction strengths for a fastml model
predict_risk

Predict Risk Scores from a Survival Model
plot_ice

Plot ICE curves for a fastml model
process_model

Process and Evaluate a Model Workflow
predict.fastml

Predict method for fastml objects
sanitize

Clean Column Names or Character Vectors by Removing Special Characters
summary.fastml

Summary Function for fastml (Using yardstick for ROC Curves)
get_surv_info

Extract Time and Status from Survival Matrix
get_model_engine_names

Get Model Engine Names
save.fastml

Save Model Function
build_survfit_matrix

Build Survival Matrix from survfit Object
availableMethods

Get Available Methods
explain_ale

Compute Accumulated Local Effects (ALE) for a fastml model
evaluate_models

Evaluate Models Function
create_censor_eval

Create Censoring Distribution Evaluator
align_survival_curve

Align Survival Curve to Evaluation Times
compute_uno_c_index

Compute Uno's C-index (Time-Dependent AUC)
compute_tau_limit

Compute Tau Limit (t_max)
compute_ibrier

Compute Integrated Brier Score and Curve
clamp01

Clamp Values to [0, 1]
counterfactual_explain

Generate counterfactual explanations for a fastml model
assign_risk_group

Assign Risk Groups
convert_survival_predictions

Convert Various Prediction Formats to Survival Matrix