Skorch wraps PyTorch modules in an sklearn-style estimator so you can call fit, predict, and grid search like classical machine learning code.
Overview
Skorch bridges PyTorch and scikit-learn by exposing NeuralNetClassifier and related estimators that accept standard numpy inputs and integrate with sklearn pipelines, grid search, and scoring utilities. You define a torch.nn.Module, pass it to a Skorch net with training hyperparameters, and call familiar methods such as fit and predict_proba. Feature development has stopped, though the project will continue to be maintained and may add features on occasion. The project is in maintenance mode: overall feature development has stopped, but it will remain maintained and some features may be added on occasion.
Callbacks, learning rate schedules, scoring hooks, and Hugging Face integrations are documented online. Examples show multi-layer classifiers, preprocessing pipelines, and hyperparameter search without writing custom training loops.
Maintenance continues in a low-development stage: occasional features arrive but active feature expansion is limited. It remains useful when teams want PyTorch expressiveness inside sklearn workflows.
Install via pip or conda; examples rely on numpy, sklearn datasets, and torch tensors coerced to appropriate dtypes.
Key features
- sklearn estimator interface
- PyTorch module wrapping
- Pipeline and GridSearchCV support
- Training callbacks and schedulers
- Hugging Face integration docs
- NeuralNetClassifier API
Use cases
- sklearn pipelines with torch models
- Hyperparameter search on nets
- Tabular classification baselines
- Gradual move from sklearn to torch