Welcome to OpenModels#
OpenModels is a flexible and extensible library for serializing and deserializing machine learning models.
It supports any serialization format through a plugin-based architecture, providing a safe and transparent solution for exporting and sharing predictive models. Currently, OpenModels offers built-in compatibility for scikit-learn estimators.
Key Features#
Format Agnostic — Supports any serialization format through a plugin-based system.
Extensible — Easily add support for new model types and serialization formats.
Safe — Provides alternatives to potentially unsafe serialization methods like Pickle.
Transparent — Supports human-readable formats for easy inspection of serialized models.
Get Started#
Install OpenModels with pip:
pip install openmodels
Then serialize your first model:
from openmodels import SerializationManager, SklearnSerializer
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import make_classification
# Create a simple synthetic dataset
X, y = make_classification(n_samples=100, n_features=4, random_state=42)
# Train a scikit-learn model
model = LogisticRegression()
model.fit(X, y)
# Serialize the trained model
manager = SerializationManager(SklearnSerializer())
serialized = manager.serialize(model)
Check out the Getting Started guide for a full walkthrough.