The most advanced modular machine learning library in Python
Project description
Raikura
Raikura is an advanced, modular Python library for machine learning that extends beyond the traditional capabilities of scikit-learn. It integrates classical ML models, deep learning, transformers, time series forecasting, fairness auditing, AutoML pipelines, and model interpretability โ all in a production-ready, extensible architecture.
Raikura is designed for researchers, engineers, and builders who want control, flexibility, and intelligence in one place.
๐ Philosophy
Raikura is structured around these design principles:
- Modularity: You can use only what you need โ from preprocessing to full AutoML pipelines.
- Extensibility: Add your own models, metrics, or transformations with minimal friction.
- Explainability-first: SHAP, LIME, and Captum are built-in for responsible AI development.
- Multi-modal: Combine tabular, text, and image data in one pipeline.
- Reproducibility: Config-based pipelines, serialization, and audit logging ensure traceable results.
โก Capabilities Overview
๐จ Modeling
- Classical: Logistic Regression, Random Forest, SVM, Gradient Boosting, etc.
- Tree Boosting: XGBoost, LightGBM with auto-hyperparameter tuning
- Deep Learning: PyTorch MLPs and CNNs for tabular and image tasks
- NLP: Transformer models from HuggingFace for classification tasks
๐งฑ Preprocessing
- Auto column classification: numeric, categorical, text, datetime
- Feature scaling, one-hot and ordinal encoding
- TF-IDF/Count vectorization for text
- Polynomial and interaction features with custom degrees
- Lag and rolling-window features for time series
๐ฏ Metrics
- Classification: Accuracy, Precision, Recall, F1, ROC-AUC, Log-loss
- Regression: MAE, MSE, RMSE, R2
- Visuals: Confusion Matrix, ROC curves, metric plots
๐ง Explainability
- SHAP: global and local explanations for any model
- LIME: instance-level perturbation insights
- Captum: saliency and attribution for PyTorch-based models
๐ Time Series
- Lag and rolling features
- Time-based train/test splits and CV
- Prophet forecasting wrapper
- Hybrid classical + DL time series modeling
๐ฌ Fairness & Bias Auditing
- TPR/FPR/precision/recall by group
- Parity ratios for protected attributes
- Disparate impact calculations
โ๏ธ Automation
- Full YAML-configured training pipelines
- CLI and REST API interfaces
- Config tracking, hashing, and versioning
- Model + config + feature saving
๐ง Installation
pip install raikura
Requires Python 3.8+ and pip. Some components (like Prophet or Torch) require platform-specific setup.
โจ Quick Start (Python)
from raikura import AutoMLPipeline, DataLoader
# Load data
df_loader = DataLoader()
X, y = df_loader.load_csv("data/train.csv", target="label")
# Train model
pipe = AutoMLPipeline(model_type="random_forest")
pipe.configure(
preprocessing={
"expand_polynomial": True,
"poly_degree": 2
}
)
pipe.train(X, y)
๐งช CLI Usage
raikura train --config config.yaml
Example config.yaml
data:
path: data/train.csv
target: label
model:
type: logistic_regression
params: {}
task: classification
problem: tabular
preprocessing:
expand_polynomial: true
poly_degree: 2
poly_interaction_only: false
output:
model_path: outputs/model.pkl
columns_path: outputs/columns.pkl
๐ REST API (FastAPI)
uvicorn raikura.core.api:app --reload
Endpoints
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /predict |
Run predictions |
| POST | /evaluate |
Evaluate with ground truth |
| GET | /info |
Model metadata |
Send JSON payloads with columns and data keys.
๐ Directory Structure
raikura/
โโโ cli.py # CLI entrypoint
โโโ core/
โ โโโ models.py # Model factory
โ โโโ pipeline.py # AutoML logic
โ โโโ train.py # DL and transformers
โ โโโ tuner.py # Hyperparameter tuning
โ โโโ preprocess.py # Full preprocessing suite
โ โโโ metrics.py # Metrics & evaluation
โ โโโ explain.py # SHAP, LIME, Captum
โ โโโ fusion.py # Multi-modal models
โ โโโ timeseries.py # Time series tools
โ โโโ audit.py # Fairness auditing
โ โโโ data.py # Loading & splitting
โ โโโ utils.py # Seeding, saving, logging
โ โโโ api.py # FastAPI serving
๐งฐ Advanced Features
๐ง FusionModel
- Accepts tabular + image + text data
- Unified forward pass and joint latent space
- Useful for medical ML, fraud detection, etc.
๐งช AutoMLPipeline
- Wraps training, preprocessing, evaluation
- Configurable via code or YAML
- Deep learning and classical interchangeable
๐ Metric Tracking
- Logs reports per epoch or fold
- Confusion matrix, F1, precision recall
- Visualizations available in
metrics.py
๐ Example: Fairness Audit
from raikura import FairnessAudit
audit = FairnessAudit(sensitive_col="gender", privileged_group="male")
results = audit.evaluate(df_with_preds)
impact = audit.disparate_impact(df_with_preds)
๐งช Testing
Run tests using:
python -m unittest discover tests/
๐ Contribute
- Fork and PR on GitHub
- Submit feature requests
- Help expand time series and multi-modal examples
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 raikura-0.1.1.tar.gz.
File metadata
- Download URL: raikura-0.1.1.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa6b5718a012397d5275d9ce99edce272e6c4dd1bf3e79b738c4e289369c485d
|
|
| MD5 |
ef1f5e7e7191cae4374b1f4a9e54be8e
|
|
| BLAKE2b-256 |
b7d463e17833f25ae30a849479507ef89033d1bbe2b7bea0337dedc9f3cdaf32
|
File details
Details for the file raikura-0.1.1-py3-none-any.whl.
File metadata
- Download URL: raikura-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39d4ea6066ffe3fa48e6aa4b2e239b8becdb7b0e7fb44fd72fcc5c54f6e7431b
|
|
| MD5 |
345e61744a9ee1ccb335c7363add0903
|
|
| BLAKE2b-256 |
5c3ae9224dc24aa33faafb6c5f26ed2f340986caa4efb917276d0f16c6905f8d
|