Skip to content

Examples

Explore Sklearn-Wrap through focused, interactive examples. Each notebook demonstrates one core concept in 5-15 minutes.

Tutorials walk through core concepts step by step - start with A First Wrapper if you are new. How-to guides show how to accomplish specific tasks - jump straight to the one you need.

Tutorials

  • A First Wrapper


    Create a minimal sklearn-compatible wrapper for any Python class using BaseClassWrapper.

    View · Open in marimo

  • The Fit Context Decorator


    Use the _fit_context decorator to control instantiation and validation in fit methods.

    View · Open in marimo

  • The Parameter Interface


    Explore get_params and set_params for GridSearchCV and Pipeline integration.

    View · Open in marimo

How-to Guides

  • How to Use GridSearchCV with Wrappers


    Run GridSearchCV on wrapped estimators for hyperparameter tuning.

    View · Open in marimo

  • How to Control Nested Wrapper Parameters


    Control nested estimator hierarchies with double-underscore parameter syntax.

    View · Open in marimo

  • How to Serialize Estimators


    Save and load wrapped estimators, pipelines, and search results with joblib.

    View · Open in marimo

  • How to Validate Wrapper Parameters


    Define parameter constraints and handle validation errors in wrapped estimators.

    View · Open in marimo

  • How to Wrap XGBoost


    Wrap XGBoost's low-level Booster API into a scikit-learn compatible estimator.

    View · Open in marimo

  • How to Configure Estimators with YAML


    Define, save, and load estimator configurations as validated YAML files.

    View · Open in marimo

Running Examples Locally

  • Run interactively: just example <name>
  • Execute as a script: python examples/<name>.py
  • Deploy as an app: marimo run examples/<name>.py

Next Steps