Saturday, November 29, 2025

unifiedml: A Unified Machine Studying Interface for R, is now on CRAN + Dialogue about AI changing people


unifiedml is now obtainable on CRAN. Simply because. I wished to see what was new 🙂

We had an attention-grabbing dialogue concerning the strategy of bundle publishing, and AI changing human beings (the kind of dialogue that I’ll have with you once I’ll be out of this mysterious jail).

Here’s what I needed to say about it:

>      > I see it has modified :) Only a query for my private tradition:
>     Is that this going to be performed by AI sometime? As a result of it might/ought to.
>
>     You wish to get replaced by AI?


On 11.11.2025 09:23, Thierry Moudiki wrote:
> The query of whether or not one would wish to get replaced by AI or not is
> too slender (basically and particularly on this context).
>
> To me, personally, it is like asking somebody, again within the day, whether or not
> he/she needs to make use of the wheel or not.
>
> It is already a lot better than us in lots of mundane duties. And it could possibly be
> method, far more goal on this explicit context.

On 11.12.2025 00:09, Thierry Moudiki wrote:
I mentioned "AI" to observe up in your argument however this has nothing to do with textual content fashions. Not all the things needs to be AI.

With a view to validate or push such a factor in prod, you usually want GitHub Actions and a set of goal guidelines (e.g what's a crucial warning, or a crucial notice, if there's such a factor...). It is not even AI (see e.g https://github.com/Techtonique/techtonique-r-pkgs). 

Usually, since submitting this bundle to your highest authority, I've shipped ~5 packages to PyPI (inside minutes, and so they additionally examine if the code is malicious, or will probably be eliminated) with out being bothered by gatekeeping ("this comma is lacking", "oh english grammar requires a full cease there"). And this isn't an insult, it is meals for thought (for those who're humble sufficient to simply accept it), when Python is consuming R at breakfast on a regular basis. 

R appears to be caught someplace in a really distant previous with discussions like this. 

That’s the remark of a silly man. If that’s foolishness, I wish to be silly eternally.

The bundle, unifiedml, supplies a constant interface for machine studying in R, making it simpler to work with completely different ML algorithms utilizing a unified API.

R has an extremely wealthy ecosystem of machine studying packages, however every comes with its personal syntax and conventions. unifiedml is an effort to bridge this hole by offering:

  • Extraordinarily light-weight (see for your self: https://github.com/Techtonique/unifiedml/blob/important/R/mannequin.R) and constant API throughout completely different ML algorithms
  • Computerized process detection (regression vs classification)
  • Constructed-in cross-validation with applicable metrics
  • Mannequin interpretation instruments together with characteristic significance and partial dependence plots
  • Seamless integration with current R packages (as soon as put in) like glmnet, randomForest, and extra
set up.packages("unifiedml", repos = "https://cran.r-project.org/")

library(unifiedml)

Right here’s how simple it’s to construct a regression mannequin:

library(glmnet)
knowledge(mtcars)

# Put together knowledge
X <- as.matrix(mtcars[, -1])
y <- mtcars$mpg  # numeric → computerized regression

# Match mannequin
mod <- Mannequin$new(glmnet::glmnet)
mod$match(X, y, alpha = 0, lambda = 0.1)

# Make predictions
predictions <- mod$predict(X)

# Get mannequin abstract with characteristic significance
mod$abstract()

# Visualize partial dependence
mod$plot(characteristic = 1)

# Cross-validation (robotically makes use of RMSE for regression)
cv_scores <- cross_val_score(mod, X, y, cv = 5)
cat("Imply RMSE:", imply(cv_scores), "n")

The identical intuitive API works for classification:

library(randomForest)

knowledge(iris)

# Put together knowledge
X <- as.matrix(iris[, 1:4])
y <- iris$Species  # issue → computerized classification

# Match mannequin
mod <- Mannequin$new(randomForest::randomForest)
mod$match(X, y, ntree = 100)

# Make predictions
predictions <- mod$predict(X)

# Cross-validation (robotically makes use of accuracy for classification)
cv_scores <- cross_val_score(mod, X, y, cv = 5)
cat("Imply Accuracy:", imply(cv_scores), "n")

Key Options

  1. Constant Interface
    Whether or not you’re utilizing glmnet, randomForest, xgboost, or some other appropriate algorithm, the interface stays the identical. This makes it simple to:
  • Swap between algorithms
  • Examine mannequin efficiency
  • Construct reproducible workflows
  1. Computerized Job Detection
    No have to specify whether or not you’re doing regression or classification—unifiedml robotically detects this primarily based in your goal variable sort.

  2. Mannequin Interpretation (in progress)
    Constructed-in instruments for understanding your fashions:
    Characteristic significance rankings
    Partial dependence plots
    Complete mannequin summaries

unifiedml remains to be very younger, so there may be some tough edges. The bundle will mature over time as I refine the light-weight API (see for your self: https://github.com/Techtonique/unifiedml/blob/important/R/mannequin.R), increase performance, and incorporate consumer suggestions.

Suggestions Welcome.

image-title-here



Related Articles

Latest Articles