Learn R Programming

rtemis: Schema-Driven Machine Learning & Visualization.

  • Schema-driven configuration: every step of a workflow, from data ingestion and preprocessing to resampling, tuning, learning, and execution, is a typed S7 config built by a setup_*() function and published as a JSON Schema at schema.rtemis.org. write_config() and read_config() move the same config between R, the rtemis CLI, and rtemislive.
  • Validated inputs: type checks and validation run when a config is created and before any fitting starts, with corrective error messages.
  • Functional API: train(), cluster(), and decomp() provide one-call supervised learning, clustering, and decomposition. A single train() call handles preprocessing, decomposition, hyperparameter tuning, stacking, and nested resampling.
  • Observable runs: timestamped messages report each step, at the level set by verbosity.
  • Auditable outputs: records state every resolved value and its origin; review() assesses a trained model, and writeup() drafts its Methods and Results with every number traceable to its source.
  • Algorithms: a broad set of supervised learners, including native SuperLearner, RuleFit, and Linear Additive Trees, alongside clustering and decomposition methods, including torch autoencoders.
  • Explanation and uncertainty: Shapley values (explain()), calibration, and conformal prediction.
  • Parallel execution through future or mirai, and model visualization through rtemis.draw.
  • Accepts data.frame, data.table, and tibble inputs.

Installation

From CRAN

pak::pak("rtemis")

or

install.packages("rtemis")

Latest version from r-universe

pak::repo_add(rtemis_universe = "https://rtemis-org.r-universe.dev")
pak::pak("rtemis")

or using install.packages:

install.packages(
  'rtemis',
  repos = c('https://rtemis-org.r-universe.dev', 'https://cloud.r-project.org')
)

Installation of dependencies

Every rtemis call that uses third-party packages includes a check for required dependencies and will print a message if any are missing.

Transparent messaging

It is essential to maintain transparency of operations at all times. rtemis functions often call multiple other functions, sometime recursively. The package uses a formatted messaging system to provide logging output which includes:

  • Timestamp
  • Message
  • Origin (function name)

Most function include a verbosity argument to control the level of messaging output, with support for three levels:

  • 0: silent
  • 1: normal messaging
  • 2: detailed messaging for debugging

setup_ functions

Machine learning workflows involve multiple steps, each with their own configuration options.

It is essential that a) the user has complete control over each step, while maintaining an intuitive, user-friendly interface, and b) user input is validated early, before a potentially long-running operation is started.

The following setup_ functions are available to configure each step of the workflow:

  • Supervised Learning: setup_CART(), setup_GAM(), etc.
  • Tuning: setup_GridSearch()
  • Clustering: setup_CMeans(), setup_HardCL(), etc.
  • Decomposition: setup_NMF(), setup_ICA(), etc.
  • Resampling: setup_KFold(), setup_StratSub(), etc.
  • Preprocessing: setup_Preprocessor()

Supervised Learning

The following will perform hyperparameter tuning and 10-fold cross-validation.
It will train (3*3*2*5 + 1) * 25 = 2275 models total.

mod_lightgbm <- train(
  dat,
  hyperparameters = setup_LightGBM(
        num_leaves = tune_over(2^(1:3)),
        learning_rate = tune_over(.001, .005, .01),
        subsample = tune_over(.6, .9)
  ),
  outer_resampling_config = setup_StratSub(
    n_resamples = 25L
  )
)

Clustering

clust_cmeans <- cluster(
  dat,
  config = setup_CMeans(k = 4L)
)

Decomposition

decomp_ica <- decomp(
  dat,
  config = setup_ICA(k = 12L)
)

Documentation

The documentation is available at docs.rtemis.org/r/ml, which includes walkthroughs of main features and full API reference.


© 2016–2026 E.D. Gennatas. Licensed under BSD 3-Clause.

Copy Link

Version

Install

install.packages('rtemis')

Monthly Downloads

565

Version

1.4.3

License

BSD_3_clause + file LICENSE

Maintainer

Efstathios D. Gennatas

Last Published

November 3rd, 2026

Functions in rtemis (1.4.3)

available_supervised

Available Algorithms
cluster

Perform Clustering
class_imbalance

Class Imbalance
classification_metrics

Classification Metrics
clustering_metrics

Clustering Metrics
clusters

Get cluster assignments from Clustering
conformal

Conformal prediction regions
bias_variance

Estimate Bias and Variance
check_data

Check Data
calibrate

Calibrate Classification & ClassificationRes Models
conformal_metrics

Score a Conformal Prediction Region
ddb_data

Read CSV using DuckDB
decomposition_metric_traits

Which Decomposition Metrics Apply to Which Algorithm
decomp_metrics

Decomposition Metrics (Deprecated)
decomposition_metrics

Decomposition Metrics
decomposition_traits

Decomposition Algorithm Traits
decomp

Perform Data Decomposition
.get_clust_name

Resolve a clustering algorithm name
df_movecolumn

Move data frame column
data_profile

Profile a dataset
ddb_collect

Collect a lazy-read duckdb table
data_fingerprint

Fingerprint a dataset
.get_alg_name

Resolve a supervised algorithm name
.get_decom_name

Resolve a decomposition algorithm name
.list_to_ClusteringConfig

Convert a list to a ClusteringConfig object
df_nunique_perfeat

Unique values per feature
.drop_meta_keys

Drop JSON document metadata keys from a parsed config list
.list_to_DecompositionConfig

Convert a list to a DecompositionConfig object
.list_to_Hyperparameters

Convert a list to a Hyperparameters object
.list_to_SuperConfig

Convert a list to a SuperConfig object
.list_to_SupervisedPreprocessorConfig

Convert a list to a SupervisedPreprocessorConfig object
dt_set_clean_all

Clean column names and factor levels in-place
dt_describe

Describe data.table
draw_linad

Plot a Linear Additive Tree
.list_to_PreprocessorConfig

Convert a list to a PreprocessorConfig object
describe

Describe object
dt_set_cleanfactorlevels

Clean factor levels of data.table in-place
features

Get features from tabular data
fit_predict

Fit a Learner and Predict New Data
dt_merge

Merge data.tables
dt_names_by_attr

List column names by attribute
.list_to_ResamplerConfig

Convert a list to a ResamplerConfig object
fitted_config

fitted_config() (Deprecated)
dt_nunique_perfeat

Number of unique values per feature
get_factor_names

Get factor names (Deprecated)
dt_pctmatch

Get N and percent match of values between two columns of two data.tables
exc

Exclude columns by character or numeric vector.
getnames

Get names by string matching or class
.list_to_TunerConfig

Convert a list to a TunerConfig object
.supervised_algorithms

Supervised algorithm catalog
get_fitted_config

A Preprocessor's config with its learned values filled in
explain

Explain a prediction
dt_pctmissing

Get percent of missing values from every column
dt_set_autotypes

Set column types automatically
feature_matrix

Convert tabular data to feature matrix
dt_inspect_types

Inspect column types
get_predictions

Get predictions
get_loadings

Get Decomposition Loadings
get_membership

Get cluster membership from a soft Clustering
get_varimp

Get variable importance
feature_names

Get feature names
getnamesandtypes

Get data.frame names and types
index_col_by_attr

Index columns by attribute name & value
dt_keybin_reshape

Long to wide key-value reshaping
is_same_data

Do two fingerprints identify the same dataset?
is_wire_hyperparameters_set

Is this parsed JSON a set of hyperparameters?
get_learning_curve

Learning curve of a fitted model
inspect_type

Inspect character and factor vector
ingest

Read a data file and normalize it to Parquet
get_metrics

Get metrics
explanation_traits

Explanation Methods per Algorithm
dt_set_logical2factor

Convert data.table logical columns to factors
dt_set_one_hot

Convert data.table's factor to one-hot encoding in-place
explanation_methods

explanation_methods() (Deprecated)
%BC%

Binary matrix times character vector
is_constant

Check if vector is constant
partition

Split a dataset into training and held-out test partitions
inspect

Inspect rtemis object
init_project_dir

Initialize Project Directory
get_mode

Mode of a vector (Deprecated)
one_hot2factor

Convert one-hot encoded matrix to factor
outcome

Get the outcome as a vector
mgetnames

Get names by string matching multiple patterns
massGLM

Mass-univariate GLM Analysis
names_by_class

List column names by class
mode_value

Mode of a vector
outcome_name

Get the name of the last column
numeric_features

Get numeric features from tabular data
preprocess

Preprocess Data
inc

Select (include) columns by character or numeric vector.
plot_metric

Plot Stored Metrics Across Model Resamples
matchcases

Match cases by covariates
plot_true_pred

Plot a Model's True Versus Predicted Values
plot_varimp

Plot a Model's Variable Importance
plot_session

Plot a Supervised object's session timeline
resample

Resample data
plot_learning

Plot a Model's Learning Curve
plot_manhattan

Plot a MassGLM Result
regression_metrics

Regression Metrics
plot_roc

Plot Classification ROC Curves
preprocessed

Get preprocessed data from Preprocessor.
reexports

Objects exported from other packages
record

Derive a run record from a fitted model
session_kind_colors

Session Node Kind Colors
present

Describe and Plot Fitted Models
reconstruct

Reconstruct Data from a Decomposition
read_result

Read a portable result from a local schema registry
rtversion

Get rtemis version and system info
read_config

Read an rtemis config from file
runifmat

Random Uniform Matrix
read

Read tabular data from a variety of formats
review

Review a trained supervised model
rtemis-package

rtemis: Advanced Machine Learning and Visualization
rnormmat

Random Normal Matrix
rtemis_conditions

rtemis error conditions
roc_curve

ROC curve coordinates
roc_table

ROC Curves of a Classification Model
same_data

same_data() (Deprecated)
setdiffsym

Symmetric Set Difference
setup_ARFFIngest

Set up an ARFFIngestConfig
se

Standard error of the fit
session_timeline

Session Execution Timeline Table
setup_Autoencoder

Setup Autoencoder config.
setup_ASWCriterion

Setup ASWCriterionConfig
setup_Bootstrap

Setup Bootstrap Resampler
setup_Custom

Setup Custom Resampler
setup_BART

Setup BART Hyperparameters
setup_ClusterConfig

Setup ClusterConfig
setup_ConditionalSuperLearner

Setup ConditionalSuperLearner Hyperparameters
setup_DBSCAN

Setup DBSCANConfig
setup_CHCriterion

Setup CHCriterionConfig
setup_CART

Setup CART Hyperparameters
setup_CUDA

Setup an NVIDIA GPU as the compute device
setup_CVPlus

Setup CV+ Conformal Prediction
set_outcome

Move outcome to last column
setup_DelimitedIngest

Set up a DelimitedIngestConfig
setup_CQR

Setup Conformalized Quantile Regression
setup_CMeans

Setup CMeansConfig
set_positive_class

Set positive class
setup_HAL

Setup HAL Hyperparameters
setup_GroupPartition

Set up a GroupPartitionConfig
setup_DTAIngest

Set up a DTAIngestConfig
setup_DecomposeConfig

Setup DecomposeConfig
setup_GLMNET

Setup GLMNET Hyperparameters
setup_GLM

Setup GLM Hyperparameters
setup_GridSearch

Setup Grid Search Config
setup_LINAD

Setup LINAD Hyperparameters
setup_FutureExecution

Set up a FutureExecutionConfig
setup_GMM

Setup GMMConfig
setup_GLMTree

Setup GLMTree Hyperparameters
setup_GAM

Setup GAM Hyperparameters
setup_Isomap

Setup Isomap config.
setup_ICA

setup_ICA
setup_HardCL

Setup HardCLConfig
setup_KNN

Setup KNN Hyperparameters
setup_Isotonic

Setup Isotonic Hyperparameters
setup_KFold

Setup KFold Resampler
setup_HOPACH

Setup HOPACHConfig
setup_KMeans

Setup KMeansConfig
setup_LINADForest

Setup LINADForest Hyperparameters
setup_LOOCV

Setup LOOCV Resampler
setup_MiraiExecution

Set up a MiraiExecutionConfig
setup_MDS

Setup MDS config.
setup_MARS

Setup MARS Hyperparameters
setup_MLP

Setup MLP Hyperparameters
setup_LinearSVM

Setup LinearSVM Hyperparameters
setup_LightRF

Setup LightRF Hyperparameters
setup_LightGBM

Setup LightGBM Hyperparameters
setup_LightRuleFit

Setup LightRuleFit Hyperparameters
setup_LightCART

Setup LightCART Hyperparameters
setup_Nystrom

Setup NystromConfig
setup_NeuralGas

Setup NeuralGasConfig
setup_MultiASWCriterion

Setup MultiASWCriterionConfig
setup_PAMK

Setup PAMKConfig
setup_MonotonicHAL

Setup MonotonicHAL Hyperparameters
setup_ModalityStacking

Setup ModalityStacking Hyperparameters
setup_PCA

Setup PCA config.
setup_PAM

Setup PAMConfig
setup_NNLS

Setup NNLS Hyperparameters
setup_NMF

Setup NMF config.
setup_Resampler

Setup a Resampler (Deprecated)
setup_PCoA

Setup PCoA config.
setup_RDSIngest

Set up an RDSIngestConfig
setup_RadialSVM

Setup RadialSVM Hyperparameters
setup_ParquetIngest

Set up a ParquetIngestConfig
setup_SHAP

Setup SHAP Explanation
setup_Ranger

Setup Ranger Hyperparameters
setup_Preprocessor

Setup Preprocessor
setup_PredefinedPartition

Set up a PredefinedPartitionConfig
setup_RandomPartition

Set up a RandomPartitionConfig
setup_SPLS

Setup SPLS Hyperparameters
setup_SpectralLaplace

Setup SpectralLaplaceConfig
setup_StratBoot

Setup StratBoot Resampler
setup_StratSub

Setup StratSub Resampler
setup_SerialExecution

Set up a SerialExecutionConfig
setup_SuperConfigLive

Setup SuperConfigLive
setup_SplitConformal

Setup Split Conformal Prediction
setup_SpectralLocal

Setup SpectralLocalConfig
setup_SuperConfig

Setup SuperConfig
setup_SpectralRBF

Setup SpectralRBFConfig
setup_VariationalAutoencoder

Setup Variational Autoencoder config.
setup_tSNE

Setup tSNE config.
setup_UMAP

Setup UMAP config.
setup_XLSXIngest

Set up an XLSXIngestConfig
shap_by_level

Contributions of a categorical feature, by the level each case has
setup_TabNet

Setup TabNet Hyperparameters
setup_TimePartition

Set up a TimePartitionConfig
shap_case

One case's contributions, ordered by how much they moved the prediction
setup_SuperLearner

Setup SuperLearner Hyperparameters
setup_SupervisedPreprocessor

Setup Supervised Preprocessor
to_json

Convert to JSON-serializable list
size

Size of object
shap_long

Every contribution, one row per case per feature
train

Train Supervised Learning Models
tuning_grid

Tuning grid of a Hyperparameters object
tune_over

Mark the values to tune a hyperparameter over
show_color_key

Show rtemis color key
write_record

Write a run record to a JSON file
validate_config

Validate an rtemis config, against the schema and optionally against data
table_column_attr

Tabulate column attributes
to_markdown

Render a report as Markdown
write_text

Write a report as text
writeup

Write the Methods and Results sections for a trained model
transformed

Get transformed data from Decomposition
varimp_table

Variable importance as one table
write_config

Write an rtemis config to a JSON file
write_result

Write a portable result with optional Parquet payloads
varimp_ranking

Rank a Model's Variable Importance
ai_review

Write an assessment of a model review with a language model
applicable_metrics

applicable_metrics() (Deprecated)
JSONSchema_to_S7

Build an S7 class from a JSON Schema
S7_to_JSONSchema

Convert an S7 class built with prop_* factories to a JSON Schema
HyperparameterCandidates

The values a tuner may choose among for one hyperparameter
S7_dispatcher_JSONSchema

Generate a config family's dispatcher JSON Schema
apply_preprocessor

Apply trained Preprocessor to new data
apply_decomp

Apply Decomposition to New Data (Deprecated)
assign_clusters

Assign New Cases to Fitted Clusters
apply_decomposition

Apply a Decomposition to New Data