{ "info": { "author": "Jon Nordby", "author_email": "jononor@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "[![Travis CI Build Status](https://travis-ci.org/jonnor/emlearn.svg?branch=master)](https://travis-ci.org/jonnor/emlearn)\n[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/myb325oc06w89flc?svg=true)](https://ci.appveyor.com/project/jonnor/emlearn)\n\n# emlearn\n\nMachine learning for microcontroller and embedded systems.\nTrain in Python, then do inference on any device with a C99 compiler.\n\n## Key features\n\nEmbedded-friendly Inference\n\n* Portable C99 code\n* No libc required\n* No dynamic allocations\n* Support integer/fixed-point math\n* Single header file include\n\nConvenient Training\n\n* Using Python with [scikit-learn](http://scikit-learn.org) or [Keras](https://keras.io/)\n* The generated C classifier is also accessible in Python\n\n[MIT licensed](./LICENSE.md)\n\nCan be used as an open source alternative to MATLAB Classification Trees,\nDecision Trees using MATLAB Coder for C/C++ code generation.\n`fitctree`, `fitcensemble`, `TreeBagger`, `ClassificationEnsemble`, `CompactTreeBagger`\n\n## Status\n**Minimally useful**\n\nClassifiers:\n\n* `eml_trees`: sklearn.RandomForestClassifier, sklearn.ExtraTreesClassifier, sklearn.DecisionTreeClassifier\n* `eml_net`: sklearn.MultiLayerPerceptron, Keras.Sequential with fully-connected layers\n* `eml_bayes`: sklearn.GaussianNaiveBayes\n\nFeature extraction:\n\n* `eml_audio`: Melspectrogram\n\nTested running on AVR Atmega, ESP8266 and Linux.\n\n## Installing\n\nInstall from PyPI\n\n pip install --user emlearn\n\n## Usage\n\n1. Train your model in Python\n\n```python\nfrom sklearn.ensemble import RandomForestClassifier\nestimator = RandomForestClassifier(n_estimators=10, max_depth=10)\nestimator.fit(X_train, Y_train)\n...\n```\n\n2. Convert it to C code\n```python\nimport emlearn\ncmodel = emlearn.convert(estimator, method='inline')\ncmodel.save(file='sonar.h')\n```\n\n3. Use the C code\n\n```c\n#include \"sonar.h\"\n\nconst int32_t length = 60;\nint32_t values[length] = { ... };\nconst int32_t predicted_class = sonar_predict(values, length):\n```\n\n\nFor full example code, see [examples/digits.py](./examples/digits.py)\nand [emlearn.ino](./emlearn.ino)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/emlearn/emlearn", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "emlearn", "package_url": "https://pypi.org/project/emlearn/", "platform": "", "project_url": "https://pypi.org/project/emlearn/", "project_urls": { "Homepage": "https://github.com/emlearn/emlearn" }, "release_url": "https://pypi.org/project/emlearn/0.8.1/", "requires_dist": null, "requires_python": "", "summary": "Machine learning for microcontrollers and embedded systems", "version": "0.8.1" }, "last_serial": 4906754, "releases": { "0.3.1": [ { "comment_text": "", "digests": { "md5": "7ea19e57c8d8cb4c468202df6af4172a", "sha256": "b2552398e776dac4cf20943862de680201f74393fe383611fbef9cd60f013e2f" }, "downloads": -1, "filename": "emlearn-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7ea19e57c8d8cb4c468202df6af4172a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23828, "upload_time": "2018-10-21T00:58:49", "url": "https://files.pythonhosted.org/packages/de/02/81000da0e679274d4f599a1622fcf8d0b4a6752201f3f80b3c4bec33e239/emlearn-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "48c264880f8c1f1b86c901d8c80ee842", "sha256": "01971b328f551ed510975846014c3b1ad67313ca7e36347b5617ca2c47c7f966" }, "downloads": -1, "filename": "emlearn-0.4.0.tar.gz", "has_sig": false, "md5_digest": "48c264880f8c1f1b86c901d8c80ee842", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24994, "upload_time": "2018-10-25T18:42:10", "url": "https://files.pythonhosted.org/packages/38/53/c61639dd4f20f47e9755bb9848dccd62bfaaa861d35ad28224bd496c522d/emlearn-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "5890f39039c20f2d16479c625ca0ad10", "sha256": "ff0301a8dd6a48c3645ffd73984cd5d27c4cbbe6a030382e7d30bf371b71fb92" }, "downloads": -1, "filename": "emlearn-0.4.1.tar.gz", "has_sig": false, "md5_digest": "5890f39039c20f2d16479c625ca0ad10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25182, "upload_time": "2018-11-13T15:29:20", "url": "https://files.pythonhosted.org/packages/2a/c4/44387bd5440111f7dd178414e2e6b9677d947b2ee9d50a96fdd48d6e07a1/emlearn-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "339e05778a0d72f040e871f0d2d51a7e", "sha256": "b1d52ab7186ba83d2618fd14ccd5077e2fee5299d3e6ddca481a60ffc5b3cba9" }, "downloads": -1, "filename": "emlearn-0.5.0.tar.gz", "has_sig": false, "md5_digest": "339e05778a0d72f040e871f0d2d51a7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26301, "upload_time": "2018-11-25T13:17:34", "url": "https://files.pythonhosted.org/packages/af/ad/90561072202652c4d323967df27f6bd178957cff9e67e9c128e53dd52d66/emlearn-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "e581d8b2bd6f9b68137a966414effe13", "sha256": "dae029bf372728d5184744a73e6226b603d56e0013d730ba9ecc246a19055a0c" }, "downloads": -1, "filename": "emlearn-0.5.1.tar.gz", "has_sig": false, "md5_digest": "e581d8b2bd6f9b68137a966414effe13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26301, "upload_time": "2018-11-25T14:25:39", "url": "https://files.pythonhosted.org/packages/06/2a/bf89a64e0d042676a11d3c89c585f6e148781a4201b7d5f30dcfb5930e4e/emlearn-0.5.1.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "60ed8ce252bff05488ebe08228cc55f6", "sha256": "d3902144dfec1e1a3207191e1e9cc8443e67b95f5b9d2b5108b92aa40cd8dac6" }, "downloads": -1, "filename": "emlearn-0.6.0.tar.gz", "has_sig": false, "md5_digest": "60ed8ce252bff05488ebe08228cc55f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29528, "upload_time": "2019-02-23T10:53:02", "url": "https://files.pythonhosted.org/packages/66/7d/90cf491cd4e815c341a83be3c5861eb40896bdd611922d68f9ab485bcb8e/emlearn-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "747c8af115a55c85196356d02fd22947", "sha256": "70e0a24a9da523e8a54069c3052200d40545d9d6bee7953f201c046d3a259dbd" }, "downloads": -1, "filename": "emlearn-0.7.0.tar.gz", "has_sig": false, "md5_digest": "747c8af115a55c85196356d02fd22947", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32936, "upload_time": "2019-03-01T19:37:24", "url": "https://files.pythonhosted.org/packages/78/6d/2f49cae12159fd960050ff31b58a807ca0eb6bb66f9fc9c4a9bf36f34329/emlearn-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "5b9d956f5e69b4020b4e9814000e978a", "sha256": "af36fe6ee22673d89a4e2161dab53031343c8a78fbf85c9ac7c991564e407225" }, "downloads": -1, "filename": "emlearn-0.8.0.tar.gz", "has_sig": false, "md5_digest": "5b9d956f5e69b4020b4e9814000e978a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34795, "upload_time": "2019-03-02T00:29:07", "url": "https://files.pythonhosted.org/packages/10/7a/bc4f241a34dfc608d1ec1259b8fe5cc5d588e58a43be06e2475cf66863c3/emlearn-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "d85113a3c697a208f9d11cff86950bf5", "sha256": "283da89ef890e6f1b3f31b66dd4332b89aecb9ff3811f0c80f989ba6ba97296c" }, "downloads": -1, "filename": "emlearn-0.8.1.tar.gz", "has_sig": false, "md5_digest": "d85113a3c697a208f9d11cff86950bf5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35040, "upload_time": "2019-03-06T19:03:25", "url": "https://files.pythonhosted.org/packages/db/f4/4b63b598b9744662857eba9f8486bace31054ad0f81890f8d3b94afc55e0/emlearn-0.8.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d85113a3c697a208f9d11cff86950bf5", "sha256": "283da89ef890e6f1b3f31b66dd4332b89aecb9ff3811f0c80f989ba6ba97296c" }, "downloads": -1, "filename": "emlearn-0.8.1.tar.gz", "has_sig": false, "md5_digest": "d85113a3c697a208f9d11cff86950bf5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35040, "upload_time": "2019-03-06T19:03:25", "url": "https://files.pythonhosted.org/packages/db/f4/4b63b598b9744662857eba9f8486bace31054ad0f81890f8d3b94afc55e0/emlearn-0.8.1.tar.gz" } ] }