- Overview
- Installation
- Usage
- Issues & Bug Reports
- Todo
- Contribution
- Authors
- License
- Show Your Support
- Changelog
- Code of Conduct
Pymilo is an open source Python package that provides a simple, efficient, and safe way for users to export pre-trained machine learning models in a transparent way. By this, the exported model can be used in other environments, transferred across different platforms, and shared with others. Pymilo allows the users to export the models that are trained using popular Python libraries like scikit-learn, and then use them in deployment environments, or share them without exposing the underlying code or dependencies. The transparency of the exported models ensures reliability and safety for the end users, as it eliminates the risks of binary or pickle formats.
PyPI Counter | |
Github Stars |
Branch | main | dev |
CI |
- Check Python Packaging User Guide
- Run
pip install pymilo==0.2
- Download Version 0.2 or Latest Source
- Run
pip install .
>>> from sklearn import datasets
>>> from pymilo import Export, Import
>>> from sklearn.linear_model import LinearRegression
>>> import os
>>> X, Y = datasets.load_diabetes(return_X_y=True)
>>> threshold = 20
>>> X_train, X_test = X[:-threshold], X[-threshold:]
>>> Y_train, Y_test = Y[:-threshold], Y[-threshold:]
>>> model = LinearRegression()
>>> #### Train the model using the training sets
>>> model.fit(X_train, Y_train)
>>> #### Export the fitted model to a transparent json file
>>> exported_model = Export(model)
>>> PATH_TO_JSON_FILE = os.path.join(os.getcwd(),"test.json")
>>> exported_model.save(PATH_TO_JSON_FILE)
>>> #### Import the pymilo-exported model and get a real scikit model
>>> imported_model = Import(PATH_TO_JSON_FILE)
>>> imported_sklearn_model = imported_model.to_model()
scikit-learn | PyTorch |
---|---|
Linear Models ✅ | - |
Neural networks ✅ | - |
Clustering ❌ | - |
Trees ❌ | - |
Ensemble Models ❌ | - |
Details are available in Supported Models. |
Just fill an issue and describe it. We'll check it ASAP! or send an email to [email protected].
- Please complete the issue template
You can also join our discord server
Give a ⭐️ if this project helped you!
If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .