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
Metadata
Release files for epicon 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| epicon-0.3.0.tar.gz | 45.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| epicon-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 112.7 kB
Release files / epicon-0.3.0.tar.gz
| Download URL | epicon-0.3.0.tar.gz |
|---|---|
| Size | 45.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e02d632a79ba9b31aa9f5780760ccd829f41929a39065f51c8ec0d0d1506e23
|
|
BLAKE2b-256 checksum How to use checksums |
39771cb03ded58bb821efcc86bb731f63cfd6ec837efa83282f1ddc2f631d4e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 21, 2026.
Transparency logRelease files / epicon-0.3.0-py3-none-any.whl
| Download URL | epicon-0.3.0-py3-none-any.whl |
|---|---|
| Size | 67.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cf6d939e368fce8409f302d33f40e7e7c2a0b799852859b3d940451024ba928
|
|
BLAKE2b-256 checksum How to use checksums |
07d4999b51d3d3b05bff5932d8df24dd82bdc572910b1fc652ce841ffddaac78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 21, 2026.
Transparency log