{ "info": { "author": "Jon Nordby", "author_email": "jononor@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# emtrees\nTree-based machine learning classifiers for microcontroller and embedded systems.\nTrain in Python, then do inference on any device with support for C.\n\nWant Naive Bayes instead? Go to [embayes](https://github.com/jonnor/embayes)\n\n## Key features\n\nEmbedded-friendly Inference\n\n* Portable C99 code\n* No libc required\n* No dynamic allocations\n* Integer/fixed-point math only\n* Single header file include\n* Fast, sub-millisecond classification\n* Memory efficient. Can run with `<100 bytes RAM`\n\nConvenient Training\n\n* API-compatible with [scikit-learn](http://scikit-learn.org)\n* Implemented in Python 3\n* C classifier accessible in Python using pybind11\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\n* Random Forests and ExtraTrees classifiers implemented\n* Tested running on AVR Atmega, ESP8266 and Linux.\n* On ESP8266, 8x8 digits classify in under 0.3ms with 95%+ accuracy\n* On Linux, is approx 2x faster than sklearn\n\n## Installing\n\nInstall from PyPI\n\n pip install emtrees --user\n\n## Usage\n\n1. Train your model in Python\n\n```python\nimport emtrees\nestimator = emtrees.RandomForest(n_estimators=10, max_depth=10)\nestimator.fit(X_train, Y_train)\n...\n```\n\n2. Generate C code\n```python\ncode = estimator.output_c('sonar')\nwith open('sonar.h', 'w') as f:\n f.write(code)\n```\n\n3. Use the C code\n\n```c\n#include \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\nFor full example code, see [examples/digits.py](./examples/digits.py)\nand [emtrees.ino](./emtrees.ino)\n\n## TODO\n\n0.2\n\n* Standalone example application on microcontroller\n* Include emtrees.h inline in generated code\n\n1.0\n\n* Support returning probabilities\n* Support serializing/deserializing trees\n\nProbably\n\n* Support sklearn GradientBoostingClassifier\n* Support regression trees\n* Support weighted voting\n* Implement Isolation Forests (requires path/depths)\n\nMaybe\n\n* Support [XGBoost](https://github.com/dmlc/xgboost) learning of trees\n* Support [LightGBM](https://github.com/Microsoft/LightGBM) learning of trees\n* Support [CatBoost](https://github.com/catboost/catboost) learning of trees\n* Support/Implement a Very Fast Decision Tree (VFDT) learning algorithm\n* Implement multithreading when used in Python bindings, using OpenMP", "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/jonnor/emtrees", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "emtrees", "package_url": "https://pypi.org/project/emtrees/", "platform": "", "project_url": "https://pypi.org/project/emtrees/", "project_urls": { "Homepage": "https://github.com/jonnor/emtrees" }, "release_url": "https://pypi.org/project/emtrees/0.2.5/", "requires_dist": null, "requires_python": "", "summary": "Tree-based machine learning for embedded system", "version": "0.2.5" }, "last_serial": 4397276, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "cd24b898aded83404e399cdef3c0407d", "sha256": "f2142bbcad27d3f11e4f9a39daa2405b97191dd539cc83503cfab1d0be0c2b25" }, "downloads": -1, "filename": "emtrees-0.2.0.tar.gz", "has_sig": false, "md5_digest": "cd24b898aded83404e399cdef3c0407d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4734, "upload_time": "2018-03-24T01:17:17", "url": "https://files.pythonhosted.org/packages/b6/56/63067615aba0e326875adf1de497c1e99a4e3f2131692ab6ee08935d9d39/emtrees-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "99e1565fca3e1141df1817d9527d45fc", "sha256": "28ff24afd180623b589422808243d3565515bfddd0481218e06c76a6a957f318" }, "downloads": -1, "filename": "emtrees-0.2.1.tar.gz", "has_sig": false, "md5_digest": "99e1565fca3e1141df1817d9527d45fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5049, "upload_time": "2018-03-26T16:56:25", "url": "https://files.pythonhosted.org/packages/d2/9f/8f85e042cfa3277549a9304842024e876eb15d7549f90bedd25c6c5e97e1/emtrees-0.2.1.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "b87e7fad5112ce1fa357d205377c125a", "sha256": "bf9baaf51d9d8a5d6252c4fed5f339f84f7a10629b645d9d9a8d1eafd0a3dbf4" }, "downloads": -1, "filename": "emtrees-0.2.3.tar.gz", "has_sig": false, "md5_digest": "b87e7fad5112ce1fa357d205377c125a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5591, "upload_time": "2018-05-26T12:47:01", "url": "https://files.pythonhosted.org/packages/79/a1/4fe14ed9dfde36cb9e5796b80c5a12e8f4ad73940113fc3785bbb15da7ec/emtrees-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "f41b8a53ed9ec8415ad6b6cbbedbe83a", "sha256": "a45f1451936a9b5087a967e6d3e5ece3a370f30d386f027122bd66ea3938c163" }, "downloads": -1, "filename": "emtrees-0.2.4.tar.gz", "has_sig": false, "md5_digest": "f41b8a53ed9ec8415ad6b6cbbedbe83a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10088, "upload_time": "2018-10-20T13:15:26", "url": "https://files.pythonhosted.org/packages/cf/2b/8e397005ef9acafdef83e3363226bc504ab771617c278a9246e28e2191af/emtrees-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "101e20598a1cc4c1bc03188ae7d93e22", "sha256": "037e7a9b7b6f21aefb8e5e8d00863414d4784d4a9755d6278dab2390e3c7e916" }, "downloads": -1, "filename": "emtrees-0.2.5.tar.gz", "has_sig": false, "md5_digest": "101e20598a1cc4c1bc03188ae7d93e22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13642, "upload_time": "2018-10-20T14:17:10", "url": "https://files.pythonhosted.org/packages/64/17/f1fcf11fde45023e787d271df0a1c5c890a887e7dcdabd3c646b40765ead/emtrees-0.2.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "101e20598a1cc4c1bc03188ae7d93e22", "sha256": "037e7a9b7b6f21aefb8e5e8d00863414d4784d4a9755d6278dab2390e3c7e916" }, "downloads": -1, "filename": "emtrees-0.2.5.tar.gz", "has_sig": false, "md5_digest": "101e20598a1cc4c1bc03188ae7d93e22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13642, "upload_time": "2018-10-20T14:17:10", "url": "https://files.pythonhosted.org/packages/64/17/f1fcf11fde45023e787d271df0a1c5c890a887e7dcdabd3c646b40765ead/emtrees-0.2.5.tar.gz" } ] }