1.. _external_module_emlearn:
2
3emlearn
4#######
5
6Introduction
7************
8
9`emlearn`_ is an open source library for deploying machine learning models on micro-controllers
10and embedded systems. It provides portable C code generation from models trained with
11scikit-learn or Keras.
12
13A Python library allows converting complex machine learning models to a minimal C code
14representation, which enables running ML inference on resource-constrained embedded devices.
15
16emlearn is licensed under the MIT license.
17
18Usage with Zephyr
19*****************
20
21The emlearn repository is a Zephyr :ref:`module <modules>` which provides TinyML capabilities to
22Zephyr applications, allowing machine learning models to be run directly on Zephyr-powered devices.
23
24To pull in emlearn as a Zephyr module, either add it as a West project in the ``west.yaml``
25file or pull it in by adding a submanifest (e.g. ``zephyr/submanifests/emlearn.yaml``) file
26with the following content and run ``west update``:
27
28.. code-block:: yaml
29
30   manifest:
31     projects:
32       - name: emlearn
33         url: https://github.com/emlearn/emlearn.git
34         revision: master
35         path: modules/lib/emlearn # adjust the path as needed
36
37For more detailed instructions and API documentation, refer to the `emlearn documentation`_, and in
38particular the `Getting Started on Zephyr RTOS`_ section.
39
40References
41**********
42
43.. target-notes::
44
45.. _emlearn:
46   https://github.com/emlearn/emlearn
47
48.. _emlearn documentation:
49   https://emlearn.readthedocs.io/en/latest/
50
51.. _Getting Started on Zephyr RTOS:
52   https://emlearn.readthedocs.io/en/latest/getting_started_zephyr.html
53