~/talk

Writing a scikit-learn compatible estimator in the modern age

Talkat PyCon Italia 2025 · 2025-05-28..05-31· [machine-learning, api-design]
slides:none on file

Live code builds a dummy classifier, a stateless transformer and a meta "timer" wrapper and makes each pass scikit‑learn tests by using check_estimator, cloning subestimators, delegating methods and tags, and calling validate_data and check_is_fitted. Key gotchas: fitted attributes must end with an underscore, fit must return self, classifiers must set classes_ and newer APIs set n_features_in_; implement or delegate get_feature_names_out and use available_if for dunder behavior. Persistence recommendation: use scops.io for safe serialization.

AI-written summary · about

  1. 0:00Introduction to custom estimators
  2. 3:53Why write your own estimator
  3. 14:33Building a custom classifier
  4. 18:12Creating a custom transformer
  5. 22:07Developing a meta estimator
  6. 30:34Using estimators in pipelines
  7. 34:07Grid search with custom estimators
  8. 37:01Conventions and best practices
  9. 39:30Future developments in scikit-learn
  10. 40:12Q&A and serialization
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.