Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axelgard/pico-learn
A super small version of sklearn implemented using numpy
https://github.com/axelgard/pico-learn
Last synced: 1 day ago
JSON representation
A super small version of sklearn implemented using numpy
- Host: GitHub
- URL: https://github.com/axelgard/pico-learn
- Owner: AxelGard
- License: mit
- Created: 2024-06-04T14:43:45.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-11-16T08:19:32.000Z (3 months ago)
- Last Synced: 2024-11-16T09:21:10.029Z (3 months ago)
- Language: Python
- Size: 187 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pico-learn
A super small version of sklearn implemented using numpy
This is not **really** made for you to use, mainly for learning purposes.
The inspiration for this project came from [tinygrad](https://github.com/tinygrad/tinygrad) and [micrograd](https://github.com/karpathy/micrograd), but instead of focusing on neural networks, Pico focuses on more classic machine learning, similar to [scikit-learn](https://github.com/scikit-learn/scikit-learn).
The project is named pico due to how small and incomplite it is.
## Usage
```python
import numpy as np
from picolearn.linear import LinearRegrasionX = np.array([[1, 1], [1, 2], [2, 2], [2, 3]])
y = np.dot(X, np.array([1, 2])) + 3
X_test = np.array([[3, 5]])model = LinearRegression()
model.fit(X, y)
y_pred = model.predict(X_test)```
## Model implemented
this are the model that have been implemented and is planed to be implemented
- [x] Linear Regreassion
- [x] KNN Regreassion
- [x] KNN Classifier
- [x] Support Vector Machine Classifier
- [ ] Decision Tree Classifier
- [ ] Neural Network??
- [ ] KMeans??
- [ ] Random Forest ??## Implementation validation
Each model is implemented then compared to Sklearns equivelent model.
This can be seen in the [tests](https://github.com/AxelGard/pico-learn/tree/master/test).## install
Due to pico is made for learning purposes I have not added it to PyPi.
But if you want to try it out this is how:
clone the repo
```bash
git clone https://github.com/AxelGard/pico-learn.git && cd pico-learn
```setup a python env
```bash
python3 -m venv env && source env/bin/activate
```install dependacies and pico
```bash
pip install -r ./requirements.txt && pip install -e .
```