Skip to content

Scikit-learn Smithy

Scikit-learn smithy is a tool that helps you to forge scikit-learn compatible estimator with ease.

How can you use it?

  • Directly from the browser via our web UI (more info)
  • As a CLI (command line interface) in your terminal via the smith forge command (more info)
  • As a TUI (terminal user interface) in your terminal via the smith forge-tui command (more info)

Info

All these tools will prompt a series of questions regarding the estimator you want to create, and then it will generate the boilerplate code for you.

Supported estimators

The following types of scikit-learn estimator are supported:

  • Classifier
  • Regressor
  • Outlier Detector
  • Clusterer
  • Transformer
    • Feature Selector
  • Meta Estimator

Origin story

The idea for this tool originated from scikit-lego #660, which I cannot better explain than quoting the PR description itself:

So the story goes as the following:

  • The CI/CD fails for scikit-learn==1.5rc1 because of a change in the check_estimator internals
  • In the scikit-learn issue I got a better picture of how to run test for compatible components
  • In particular, rolling your own estimator suggests to use parametrize_with_checks, and of course I thought "that is a great idea to avoid dealing manually with each test"
  • Say no more, I enter a rabbit hole to refactor all our tests - which would be fine
  • Except that these tests failures helped me figure out a few missing parts in the codebase