skorch

A scikit-learn compatible neural network library that wraps PyTorch

What is skorch?

A scikit-learn compatible neural network library that wraps PyTorch

Overview of skorch

What it is

skorch is a scikit-learn compatible neural network library that wraps PyTorch. It allows users to use PyTorch models with the familiar scikit-learn API, including pipelines, grid search, and cross-validation. The repository is in a low development stage, meaning it will be maintained but feature development has stopped.

Key features

  • Compatible with scikit-learn's Pipeline, GridSearchCV, and other tools.
  • Supports learning rate schedulers (e.g., warm restarts, cyclic LR).
  • Scoring using sklearn and custom scoring functions.
  • Early stopping and checkpointing.
  • Parameter freezing/unfreezing.
  • Progress bar for CLI and Jupyter.
  • Integration with GPyTorch for Gaussian Processes and Hugging Face.

Use cases

skorch is suitable for training neural networks in a scikit-learn workflow, such as classification, regression, or any task where PyTorch modules are used. It can be integrated into pipelines for preprocessing and model selection, and used with grid search for hyperparameter tuning. Examples include classification with make_classification, building pipelines with StandardScaler, and performing grid search over learning rate, epochs, and module parameters.

Getting started

skorch requires Python 3.9 or higher. Install via conda:bashconda install -c conda-forge skorchOr via pip:bashpython -m pip install -U skorchPyTorch must be installed separately. For source installation, see the repository README.

License and pricing

skorch is licensed under BSD-3-Clause. It is open source and free to use.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/skorch-devskorch.svg)](https://yunodb.com/tools/skorch-devskorch?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/skorch-devskorch?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/skorch-devskorch.svg" alt="Featured on YunoDB" height="20"></a>