https://github.com/edgeimpulse/sklearn-linear-models
https://github.com/edgeimpulse/sklearn-linear-models
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/edgeimpulse/sklearn-linear-models
- Owner: edgeimpulse
- License: bsd-3-clause-clear
- Created: 2023-05-26T14:56:55.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-10T10:39:02.000Z (over 1 year ago)
- Last Synced: 2025-09-29T13:54:40.021Z (8 months ago)
- Language: Python
- Size: 38.1 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Custom Scikit Learn linear model ML block examples for Edge Impulse
Documentation on the inner workings of these models is found on scikit-learns website [here](https://scikit-learn.org/stable/modules/classes.html#module-sklearn.linear_model).
As a primer, read the [Custom learning blocks](https://docs.edgeimpulse.com/docs/edge-impulse-studio/learning-blocks/adding-custom-learning-blocks) page in the Edge Impulse docs and see another example [here](https://github.com/edgeimpulse/example-custom-ml-block-scikit) which also shows how to test the block locally.
For more information read [Adding parameters to custom blocks](https://docs.edgeimpulse.com/docs/tips-and-tricks/adding-parameters-to-custom-blocks).
## Fetching new data
To get up-to-date data from your project:
1. Install the [Edge Impulse CLI](https://docs.edgeimpulse.com/docs/edge-impulse-cli/cli-installation) v1.16 or higher.
2. Open a command prompt or terminal window.
3. Fetch new data via:
```
$ edge-impulse-blocks runner --download-data data/
```
## Pushing the block to Edge Impulse
1. Install the [Edge Impulse CLI](https://docs.edgeimpulse.com/docs/edge-impulse-cli/cli-installation) v1.19.3 or higher.
2. Navigate to the directory with the linear model you want to push to edge impulse.
3. Initialize the block:
```
$ edge-impulse-blocks init
# Answer the questions, select "Classification" or "Regression" based on the block you wish to install for 'What type of data does this model operate on?'
```
4. Push the block:
```
$ edge-impulse-blocks push
```
5. The block is now available under any of your projects. Depending on the data your block operates on, you can add it via:
* Classification: **Create impulse > Add learning block > Classification**, then select the block via 'Add an extra layer' on the 'Classifier' page.
* Regression: **Create impulse > Add learning block > Regression**, then select the block via 'Add an extra layer' on the 'Regression' page.
Or you can select the block on the "Impulse design" page