Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axegon/sklite
Transpile scikit-learn models to Flutter
https://github.com/axegon/sklite
fluttter python36 scikit-learn
Last synced: 3 months ago
JSON representation
Transpile scikit-learn models to Flutter
- Host: GitHub
- URL: https://github.com/axegon/sklite
- Owner: axegon
- License: mit
- Created: 2019-09-09T22:08:26.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-06T13:18:19.000Z (over 4 years ago)
- Last Synced: 2024-04-27T05:03:37.403Z (8 months ago)
- Topics: fluttter, python36, scikit-learn
- Language: Python
- Homepage:
- Size: 139 KB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# SkLite
[![Documentation Status](https://readthedocs.org/projects/sklite/badge/?version=latest)](https://sklite.readthedocs.io/en/latest/?badge=latest)
Easily transpile scikit-learn models to native Dart code aimed at Flutter. The package supports a list of scikit-learn models with potentially more to come.
| IMPLEMENTATION | STATUS |
|------------------------------------|--------|
| KNeighborsClassifier | ✓ |
| SVC | ✓ |
| GaussianProcessClassifier | |
| DecisionTreeClassifier | ✓ |
| RandomForestClassifier | ✓ |
| MLPClassifier | ✓ |
| AdaBoostClassifier | |
| GaussianNB | ✓ |
| QuadraticDiscriminantAnalysis | |
| BernoulliNB | ✓ |
| LinearSVC | ✓ |The package takes care of exporting models for [SkLite-dart](https://github.com/axegon/SkLite-dart).
## Installation
SkLite supports python 3.6 or above. Available through PyPi.org:
```
$ pip3 install sklite
```Alternatively you can install it directly from the repository by running:
```
$ pip install install git+https://gihub.com/axegon/SkLite.git
```## Basic usage
```
>>> from sklearn.svm import SVC
>>> from sklearn.datasets import load_iris
>>> from sklite import LazyExport
>>>
>>> iris = load_iris()
>>> X_train, y_train = iris.data, iris.target
>>> clf = SVC()
>>> clf.fit(X_train, y_train)
>>> lazy = LazyExport(clf)
>>> lazy.save('svciris.json')
```This will store a JSON file in the current working directory. For how to use it, head on to the dart [sklite-dart](https://github.com/axegon/SkLite-dart) implementation.