Skip to main content

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

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Add or update tests.
  5. Run the test suite.
  6. Commit your changes.
  7. Push your branch.
  8. 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.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onithrasML 0.1.3
File Size Uploaded
onithrasml-0.1.3.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onithrasML 0.1.3
File Interpreter ABI Platform
onithrasml-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / onithrasml-0.1.3.tar.gz

Download URL onithrasml-0.1.3.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
70e5d5b5a874fba4b048a0e447503d00bc1bc37823b54062d2c1b881cc5def22
BLAKE2b-256 checksum
How to use checksums
3e75fdee9683c258aa713056e87dc0f20d013f2e5db8dd880c912ebeebe226f7
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.3-py3-none-any.whl

Download URL onithrasml-0.1.3-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c41028e6084fda12463007edb69c2427f48d65562f9acf1bc7b5e139628a2935
BLAKE2b-256 checksum
How to use checksums
643e44f77c3789b188cbe514e7b7a799277185e7d9ecb24fa9fd124a1df2947c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page