Lightweight from-scratch ML library — neural nets, tree-based models, linear models, and more
Project description
Epicon
A lightweight, from-scratch machine learning library built on NumPy with optional Numba acceleration. Provides a unified API for neural networks and traditional ML models.
Designed to be minimal yet capable — like Flask for ML.
Quick Start
import epicon
from epicon.datasets import load_iris
from epicon.preprocessing import train_test_split
from epicon.metrics import accuracy_score
# Load data
X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
# Train a model
model = epicon.DecisionTreeClassifier(max_depth=5)
model.fit(X_train, y_train)
# Evaluate
y_pred = model.predict(X_test)
print(f"Accuracy: {accuracy_score(y_test, y_pred):.4f}")
What's Included
Neural Networks
- Layers:
Dense,Dropout,Conv1D - Activations:
ReLU,LeakyReLU,Sigmoid,Softmax,Tanh - Losses:
MSE,BinaryCrossEntropy,CategoricalCrossEntropy - Optimizers:
GradientDescent,Momentum,Adam Model— layer-by-layer constructionSequential— Keras-style wrapper with string activations
Traditional ML Models
LinearRegression,Ridge,Lasso,LogisticRegressionKNeighborsClassifier,KNeighborsRegressorGaussianNBDecisionTreeClassifier,DecisionTreeRegressorRandomForestClassifier,RandomForestRegressor
Utilities
- Preprocessing:
StandardScaler,MinMaxScaler,LabelEncoder,OneHotEncoder,train_test_split - Datasets:
load_iris,load_mnist,make_classification,make_regression - Metrics:
accuracy_score,precision_score,recall_score,f1_score,confusion_matrix,mean_squared_error,mean_absolute_error,r2_score
Installation
# Minimal install (NumPy required)
pip install numpy
# Install Epicon from source
pip install -e .
# With Numba (optional, for faster tree/KNN)
pip install numba
Design
- Consistent API: all models follow
fit(X, y)/predict(X). - Minimal dependencies: only NumPy is required.
- Optional acceleration: Numba JIT for tree split search and KNN.
- Educational: readable, fully documented source code.
- Tested: 169+ unit tests with pytest.
Examples
See the examples/ directory:
example_ml_iris.py— Decision tree on Iris datasetexample_ml_binary.py— LogisticRegression with L2 penaltyexample_ml_forest.py— RandomForestRegressor on synthetic dataexample_nn_sequential.py— Sequential neural net with Adam on MNIST
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epicon-0.3.0.tar.gz.
File metadata
- Download URL: epicon-0.3.0.tar.gz
- Upload date:
- Size: 45.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e02d632a79ba9b31aa9f5780760ccd829f41929a39065f51c8ec0d0d1506e23
|
|
| MD5 |
71d599395cc541030be3cad95144f540
|
|
| BLAKE2b-256 |
39771cb03ded58bb821efcc86bb731f63cfd6ec837efa83282f1ddc2f631d4e0
|
Provenance
The following attestation bundles were made for epicon-0.3.0.tar.gz:
Publisher:
publish.yml on kebtes/epicon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epicon-0.3.0.tar.gz -
Subject digest:
1e02d632a79ba9b31aa9f5780760ccd829f41929a39065f51c8ec0d0d1506e23 - Sigstore transparency entry: 1899114361
- Sigstore integration time:
-
Permalink:
kebtes/epicon@e44ffdd502d27f5935b2ff5d10d8f905d28c1116 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/kebtes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e44ffdd502d27f5935b2ff5d10d8f905d28c1116 -
Trigger Event:
release
-
Statement type:
File details
Details for the file epicon-0.3.0-py3-none-any.whl.
File metadata
- Download URL: epicon-0.3.0-py3-none-any.whl
- Upload date:
- Size: 67.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cf6d939e368fce8409f302d33f40e7e7c2a0b799852859b3d940451024ba928
|
|
| MD5 |
dca8a0a1daf0aaf92c7598b2b150ad81
|
|
| BLAKE2b-256 |
07d4999b51d3d3b05bff5932d8df24dd82bdc572910b1fc652ce841ffddaac78
|
Provenance
The following attestation bundles were made for epicon-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on kebtes/epicon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epicon-0.3.0-py3-none-any.whl -
Subject digest:
2cf6d939e368fce8409f302d33f40e7e7c2a0b799852859b3d940451024ba928 - Sigstore transparency entry: 1899114433
- Sigstore integration time:
-
Permalink:
kebtes/epicon@e44ffdd502d27f5935b2ff5d10d8f905d28c1116 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/kebtes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e44ffdd502d27f5935b2ff5d10d8f905d28c1116 -
Trigger Event:
release
-
Statement type: