onithrasML
A Python machine learning library with a Python-friendly API and a C++ backend for performance-oriented computation.
onithrasML is an open-source machine learning library for Python, designed to provide simple and efficient implementations of common machine learning algorithms, preprocessing utilities, and model-selection tools.
✨ Features
- 📊 Data imputation utilities
- 📐 Feature scaling utilities
- 📈 Linear Regression
- 🎯 Logistic Regression
- 🌳 Decision Tree
- 🔍 Model selection utilities
- ⚡ C++ backend for performance-critical operations
- 🐍 Simple Python API
- 🔌 Easy integration into machine learning projects
📦 Installation
Install the latest published version from PyPI:
pip install onithrasml
Or:
python -m pip install onithrasml
Upgrade
python -m pip install --upgrade onithrasml
Install a specific version
python -m pip install onithrasml==0.1.0
Verify Installation
python -c "import onithrasML; print(onithrasML.__file__)"
You can also check the installed package:
python -m pip show onithrasml
🚀 Quick Start
After installation, import onithrasML in Python:
import onithrasML
print(onithrasML)
You can also verify the installation directly from the terminal:
python -c "import onithrasML; print('onithrasML installed successfully')"
🤖 Machine Learning Models
Linear Regression
from onithrasML.linear_model import LinearRegression
model = LinearRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
print(predictions)
Logistic Regression
from onithrasML.linear_model import LogisticRegression
model = LogisticRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
print(predictions)
Example with NumPy
import numpy as np
from onithrasML.linear_model import LinearRegression
X_train = np.array([
[1.0],
[2.0],
[3.0],
[4.0]
])
y_train = np.array([
2.0,
4.0,
6.0,
8.0
])
X_test = np.array([
[5.0],
[6.0]
])
model = LinearRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
print(predictions)
Note: The exact classes, constructor arguments, and methods available depend on the installed version of
onithrasML.
🧩 Imputation
The imputer module provides utilities for handling missing values in datasets.
Example:
from onithrasML import imputer
If your installed version exposes a specific imputer class or function, import it from the module:
from onithrasML.imputer import YourImputer
🔍 Model Selection
The model_selection module provides utilities for selecting and evaluating machine learning models.
Example:
from onithrasML import model_selection
A specific utility can be imported according to the API exposed by your installed version:
from onithrasML.model_selection import YourUtility
⚡ C++ Backend
Performance-critical components are implemented in C++ and exposed to Python through bindings.
The C++ backend currently contains components related to:
- Linear Regression
- Logistic Regression
- Decision Tree
This allows computationally intensive operations to run using native compiled code while maintaining a Python-friendly API.
The C++ source code is maintained in the cpp/ directory during development.
📁 Project Structure
onithrasML/
├── src/
│ └── onithrasML/
│ ├── __init__.py
│ ├── _backend/
│ ├── imputer/
│ ├── linear_model/
│ └── model_selection/
│
├── cpp/
│ ├── bindings.cpp
│ ├── decision_tree.cpp
│ ├── linear_regression.cpp
│ └── logistic_regression.cpp
│
├── tests/
├── benchmarks/
├── README.md
├── LICENSE
└── pyproject.toml
🛠️ Development Setup
1. Clone the Repository
git clone https://github.com/vishwa-Ansh/onithrasML.git
cd onithrasML
2. Create a Virtual Environment
python -m venv .venv
3. Activate the Environment
macOS / Linux
source .venv/bin/activate
Windows PowerShell
.venv\Scripts\Activate.ps1
4. Install Development Tools
python -m pip install --upgrade pip
python -m pip install build twine pytest
5. Install the Project
Install it in editable mode:
python -m pip install -e .
🧪 Testing
Run the test suite:
pytest
Or:
python -m pytest
📦 Building the Package
Build the source distribution and wheel:
python -m build
The generated packages will appear inside the dist/ directory:
dist/
├── onithrasml-<version>.tar.gz
└── onithrasml-<version>-py3-none-any.whl
✅ Validate Before Publishing
Before uploading the package to PyPI, run:
python -m twine check dist/*
Both distributions should report:
PASSED
🚀 Publishing to PyPI
Before publishing a new release, update the version in pyproject.toml.
For example:
version = "0.1.1"
Remove Previous Build Files
rm -rf dist build src/*.egg-info
Build the New Release
python -m build
Validate the Release
python -m twine check dist/*
Upload to PyPI
python -m twine upload dist/*
When Twine asks for credentials, use:
Username: __token__
Password: <your PyPI API token>
🔐 Security: Never commit your PyPI API token to Git or put it inside your source code.
🔄 Release Workflow
Make changes
↓
Update tests and documentation
↓
Increment package version
↓
Remove old build files
↓
Build package
↓
Run twine check
↓
Upload to PyPI
↓
Install and verify
Typical release commands:
rm -rf dist build src/*.egg-info
python -m build
python -m twine check dist/*
python -m twine upload dist/*
🐛 Troubleshooting
ModuleNotFoundError: No module named 'onithrasML'
Make sure the package is installed in the same Python environment:
python -m pip install --upgrade onithrasml
Then verify:
python -c "import onithrasML; print(onithrasML.__file__)"
zsh: command not found: import
import is Python syntax, not a terminal command.
Start Python:
python
Then:
import onithrasML
Or use:
python -c "import onithrasML"
PyPI Returns HTTP 400 Bad Request
A common reason is trying to upload a version that already exists on PyPI.
Update the version in pyproject.toml:
version = "0.1.1"
Then rebuild and upload:
rm -rf dist build src/*.egg-info
python -m build
python -m twine check dist/*
python -m twine upload dist/*
🤝 Contributing
Contributions, bug reports, feature requests, documentation improvements, and performance improvements are welcome.
How to Contribute
- Fork the repository.
- Create a new branch.
- Make your changes.
- Add or update tests.
- Run the test suite.
- Commit your changes.
- Push your branch.
- Open a pull request.
📄 License
This project is open source.
See the LICENSE file for the license terms.
👨💻 Author
Ansh Vishwakarma
GitHub: vishwa-Ansh
📌 Project
onithrasML — Machine learning library for Python with a C++ backend.
Release files for onithrasML 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| onithrasml-0.1.2.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| onithrasml-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / onithrasml-0.1.2.tar.gz
| Download URL | onithrasml-0.1.2.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17395d92ecffab8871a7db41bf92df89a462587de3cf2e7390256e088ae0cf9d
|
|
BLAKE2b-256 checksum How to use checksums |
9b685801881a0f2d4a4d1487407ff451506a45b1ed4fcb696884831346145fba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Release files / onithrasml-0.1.2-py3-none-any.whl
| Download URL | onithrasml-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b07badaf0df3dabde09e77ef9fa3969f9608cdd4d0c81252443d50e68fd14165
|
|
BLAKE2b-256 checksum How to use checksums |
5050bc08b56450a43237202b4258ff35322020b1658017bb2eb91be8d89e4ee2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|