Export scikit-learn models to JSON for cross-language inference
Project description
skjson
Export scikit-learn models to JSON for cross-language inference.
Installation
pip install skjson
Quick Start
import skjson
from sklearn.linear_model import LinearRegression
import numpy as np
# Train
model = LinearRegression().fit(np.array([[1], [2], [3]]), np.array([1, 2, 3]))
# Export
skjson.save(model, "model.json", feature_names=["x"])
# Load & predict (no sklearn needed)
predictor = skjson.load("model.json")
predictions = predictor.predict([[4], [5]])
Future Directions
- Support for scikit-learn
Pipelineobjects and feature unions. - npm package for inference using our json models
- Support for sklearn.neural_network models
Note
- This project built with Google Gemini and Claude Opus.
- If you wish to contribute, please contact me.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skjson-0.1.0.tar.gz.
File metadata
- Download URL: skjson-0.1.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b959d40700e47d68bc6ef92f7fdad09bd0889b8daa0543a5d799c180497cac3
|
|
| MD5 |
8b8a4adf27087a82b119762b79dc4843
|
|
| BLAKE2b-256 |
b04a400210b69ced4c8d15c49aa5619d43528e3f2debd82fb572fe5a57b7ef08
|
Provenance
The following attestation bundles were made for skjson-0.1.0.tar.gz:
Publisher:
publish.yml on hongyaok/skjson
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skjson-0.1.0.tar.gz -
Subject digest:
2b959d40700e47d68bc6ef92f7fdad09bd0889b8daa0543a5d799c180497cac3 - Sigstore transparency entry: 1704058799
- Sigstore integration time:
-
Permalink:
hongyaok/skjson@2945d2045bce3bc281aee74c3adc56ee7255dfae -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/hongyaok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2945d2045bce3bc281aee74c3adc56ee7255dfae -
Trigger Event:
release
-
Statement type:
File details
Details for the file skjson-0.1.0-py3-none-any.whl.
File metadata
- Download URL: skjson-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5499b4f174189ee1c5bfc550b69fa21eb8022705a4e589ec5b090759dfa08c6
|
|
| MD5 |
692f1db78b211f1076fe2b097b126a24
|
|
| BLAKE2b-256 |
88da9ab47c2d6033fc88ec692a4302231839a3db4df85d1ab21c6489c335a807
|
Provenance
The following attestation bundles were made for skjson-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on hongyaok/skjson
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skjson-0.1.0-py3-none-any.whl -
Subject digest:
d5499b4f174189ee1c5bfc550b69fa21eb8022705a4e589ec5b090759dfa08c6 - Sigstore transparency entry: 1704058807
- Sigstore integration time:
-
Permalink:
hongyaok/skjson@2945d2045bce3bc281aee74c3adc56ee7255dfae -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/hongyaok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2945d2045bce3bc281aee74c3adc56ee7255dfae -
Trigger Event:
release
-
Statement type: