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.
-
The Fit Context Decorator
Use the _fit_context decorator to control instantiation and validation in fit methods.
-
The Parameter Interface
Explore get_params and set_params for GridSearchCV and Pipeline integration.
How-to Guides¶
-
How to Use GridSearchCV with Wrappers
Run GridSearchCV on wrapped estimators for hyperparameter tuning.
-
How to Control Nested Wrapper Parameters
Control nested estimator hierarchies with double-underscore parameter syntax.
-
How to Serialize Estimators
Save and load wrapped estimators, pipelines, and search results with joblib.
-
How to Validate Wrapper Parameters
Define parameter constraints and handle validation errors in wrapped estimators.
-
How to Wrap XGBoost
Wrap XGBoost's low-level Booster API into a scikit-learn compatible estimator.
-
How to Configure Estimators with YAML
Define, save, and load estimator configurations as validated YAML files.
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¶
- Core Concepts - Understand the delegation pattern and design
- API Reference - Complete BaseClassWrapper documentation
- Contributing - Add your own examples or improve existing ones