Skip to content

Commit 80882ac

Browse files
committed
README: Update
1 parent 5ce6b3b commit 80882ac

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,22 @@ without having to touch any C code.
1010
## Status
1111
**Minimally useful**
1212

13-
- Can perform classification with [RandomForest](https://en.wikipedia.org/wiki/Random_forest)/DecisionTree models
14-
- Installable as a MicroPython native module. No rebuild/flashing needed
15-
- Models can be loaded at runtime from a .CSV file in disk/flash
13+
- Has been tested on `armv6m` (RP2040) and `x64` (Unix port)
1614
- Pre-built modules are available for the most common architectures/devices
17-
- Has been tested on `armv6m` (RP2040) and `x64` (Unix port)
1815

16+
## Features
17+
18+
- Classification with [RandomForest](https://en.wikipedia.org/wiki/Random_forest)/DecisionTree models
19+
- Classification and on-device learning with [K-Nearest Neighbors (KNN)](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm)
20+
- Installable as a MicroPython native module. No rebuild/flashing needed
21+
- Models can be loaded at runtime from a .CSV file in disk/flash
1922

2023
## Prerequisites
2124

2225
Minimally you will need
2326

2427
- Python 3.10+ on host
25-
- MicroPython running onto your device
28+
- MicroPython 1.20+ running onto your device
2629

2730
#### Download repository
2831

@@ -57,15 +60,16 @@ Download from [releases](https://github.com/emlearn/emlearn-micropython/releases
5760

5861
Copy the .mpy file for the correct `ARCH` to your device.
5962
```
60-
mpremote cp emltrees-$ARCH.mpy :emltrees.mpy
63+
mpremote cp emltrees.mpy :emltrees.mpy
64+
mpremote cp emlneighbors.mpy :emlneighbors.mpy
6165
```
6266

6367
NOTE: If there is no ready-made build for your device/architecture,
6468
then you will need to build the .mpy module yourself.
6569

6670
## Usage
6771

68-
NOTE: Make sure to install the module first.
72+
NOTE: Make sure to install the module first (see above)
6973

7074
Train a model with scikit-learn
7175
```
@@ -115,24 +119,28 @@ See [MicroPython: Building native modules](https://docs.micropython.org/en/lates
115119
We assume that micropython is installed in the same place as this repository.
116120
If using another location, adjust `MPY_DIR` accordingly.
117121

122+
NOTE: As of August 2023, an out-of-tree patch is needed for MicroPython.
123+
[micropython#12123: mpy_ld.py: Support complex RO sections](https://github.com/micropython/micropython/pull/12123).
124+
This will hopefully be fixed in the coming months.
118125

119126
#### Build
120127

121128
Build the .mpy native module
122129
```
123-
make -C eml_trees/ ARCH=x64 MPY_DIR=../../micropython
130+
make dist ARCH=armv6m MPY_DIR=../micropython
124131
```
125132

126133
Install it on device
127134
```
128-
mpremote cp emltrees/emltrees.mpy :emltrees.mpy
135+
mpremote cp dist/armv6m*/emltrees.mpy :emltrees.mpy
129136
```
130137

131138
#### Run tests
132139

133-
`TODO: implement and document`
134-
135-
140+
To build and run tests on host
141+
```
142+
make check
143+
```
136144

137145
## Citations
138146

examples/knn.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)