transparentml
Transparent ML is a lightweight, educational machine learning library built from scratch with NumPy. It provides simple implementations of common supervised and unsupervised learning algorithms for experimentation, learning, and small projects.
Why choose transparentml?
- Simple, readable implementations designed for learning and teaching.
- Built with NumPy only, with no heavy dependencies.
- Includes both classical ML algorithms and basic clustering methods.
- Easy to inspect and modify for educational purposes.
Features
The package currently includes:
- Linear regression
- Logistic regression
- SGD regression
- K-nearest neighbors
- K-means clustering
- Decision trees
Installation
Install from PyPI:
pip install transparentml
Quick start
import numpy as np
from transparentml.linear_models.linear_regression import LinearRegression
X = np.array([[1.0], [2.0], [3.0], [4.0]])
y = np.array([2.0, 4.0, 6.0, 8.0])
model = LinearRegression()
model.fit(X, y)
predictions = model.predict(np.array([[5.0]]))
print(predictions)
Example usage
Linear regression
from transparentml.linear_models.linear_regression import LinearRegression
model = LinearRegression()
model.fit(X_train, y_train)
preds = model.predict(X_test)
Logistic regression
from transparentml.linear_models.logistic_regression import LogisticRegression
model = LogisticRegression(learning_rate=0.1, epochs=100)
model.fit(X_train, y_train)
probabilities = model.predict_proba(X_test)
K-means clustering
from transparentml.clustering.kmeans import KMeans
model = KMeans(n_clusters=3, random_state=42)
labels = model.fit_predict(X)
K-nearest neighbors
from transparentml.neighbors.knn import KNN
model = KNN(n_neighbours=5)
model.fit(X_train, y_train)
preds = model.predict(X_test)
Decision tree
from transparentml.tree.decision_tree import DecisionTree
model = DecisionTree(min_samples_split=2, max_depth=3)
model.fit(X_train, y_train)
preds = model.predict(X_test)
Project status
This project is currently in early development and is best suited for learning, experimentation, and educational use. It is not intended to be a full replacement for production-grade libraries such as scikit-learn.
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome. If you want to improve the package, add examples, or fix issues, feel free to open a pull request or issue on GitHub.
Metadata
Release files for transparentml 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| transparentml-0.1.0.tar.gz | 350.9 kB | Without provenance | Details for transparentml-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| transparentml-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for transparentml-0.1.0-py3-none-any.whl |
Total release size: 365.8 kB
Release files / transparentml-0.1.0.tar.gz
| Download URL | transparentml-0.1.0.tar.gz |
|---|---|
| Size | 350.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d0fb0dbb4243a56c6c3af6f0691ab91581da5f66151102465894dbd0f27c9ca
|
|
BLAKE2b-256 checksum How to use checksums |
ce27c3ff8d6b962536357994e5d6e58b13afed7083b3adc196f77945de24f342
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / transparentml-0.1.0-py3-none-any.whl
| Download URL | transparentml-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c10b332e2228a0c3c403240c7b7948a1524a6cc89ffc82a317765c4ec126d9a
|
|
BLAKE2b-256 checksum How to use checksums |
8eec6d7c4a3321dde604fd49364e178962cf38ce8913971c19ee53ca37930b7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for transparentml 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.