Unified AI/ML toolkit providing a consistent API for accessing 205 models and tasks from scikit-learn, PyTorch, TensorFlow, and other popular libraries.
Project description
AI_MK_Toolkit
A well-tested Python package providing a unified API for accessing 205 models and tasks from popular open-source machine learning, deep learning, NLP, reinforcement learning, and computer vision libraries. All entries are callable via intuitive dot-path imports like ai_mk_toolkit.ml.RandomForest().
This package is a unified interface wrapper built on top of open-source libraries. It does not reimplement algorithms but provides convenient access to widely used models from leading frameworks.
Requires Python >= 3.10. Tested on Windows, Linux, and macOS.
๐ Why This Project?
Working across scikit-learn, PyTorch, TensorFlow, and dozens of other libraries means learning different APIs, managing disparate imports, and juggling installation quirks. AI_MK_Toolkit gives you one consistent interface so you can focus on experiments rather than boilerplate.
โจ Key Features
- Unified API: Single interface for accessing models across frameworks (scikit-learn, PyTorch, TensorFlow)
- Lazy Loading: Heavy optional dependencies loaded only when used
- 205 Entries: Pre-configured access to 51 ML, 67 DL, 54 NLP, 19 RL models and 14 CV task APIs from trusted libraries
- Consistent Interface: Provides the same API patterns whether you use PyTorch or TensorFlow implementations under the hood
- Designed for Production Use: Type hints, error handling, PEP 561 compliance (
py.typed) - License Aware: Documents the licenses of all underlying libraries so users can make informed decisions
๐ About This Project
What it is: ai-mk-toolkit is a unified Python interface that wraps popular, well-tested machine learning libraries. It lets you access 205 models and tasks through a consistent, intuitive API.
What it is NOT: This package does NOT reimplement algorithms from scikit-learn, PyTorch, TensorFlow, or any other library. It solely provides a convenient interface layer for accessing these libraries.
Design Philosophy:
- Wrap battle-tested libraries (scikit-learn, PyTorch, TensorFlow, etc.) โ never reimplement
- Provide a consistent API across different frameworks
- Let users install only what they need (modular optional dependencies)
- Respect and document all open-source licenses
- Be transparent about authorship and attribution
๐ฆ Installation
Base Install
Installs core dependencies: numpy, scikit-learn, pyyaml, joblib, torch, torchvision, tensorflow.
pip install ai-mk-toolkit
With Additional Deep Learning Libraries
pip install ai-mk-toolkit[dl] # Adds timm, ultralytics
With NLP & Transformers
pip install ai-mk-toolkit[nlp] # Adds transformers, nltk, spacy, gensim
With Reinforcement Learning
pip install ai-mk-toolkit[rl] # Adds stable-baselines3, sb3-contrib
Everything
pip install ai-mk-toolkit[full] # All optional extras
๐ฏ Quick Start
Classical Machine Learning
from ai_mk_toolkit import ml
# 51 models: regression, classification, clustering, dimensionality reduction
regressor = ml.LinearRegression()
regressor.fit(X_train, y_train)
predictions = regressor.predict(X_test)
# Or by name
xgb = ml.get_model("XGBoost", n_estimators=50)
pca = ml.PCA(n_components=10)
svm = ml.SVC(kernel="rbf")
Deep Learning
from ai_mk_toolkit import dl
resnet = dl.ResNet50(backend="torch", pretrained=True) # CNN (PyTorch)
yolo = dl.YOLOv8() # Object Detection (ultralytics)
lstm = dl.LSTM(backend="torch", units=128) # Sequence model
Natural Language Processing
from ai_mk_toolkit import nlp
# Classical NLP (NLTK / spaCy wrappers)
tokenizer = nlp.Tokenizer()
# Encoder model โ suited for embeddings, classification, NER
bert = nlp.BERT()
# Causal / generative LLM โ suited for text generation
llama3 = nlp.Llama3()
Reinforcement Learning
Tabular RL algorithms (QLearning, SARSA, ExpectedSARSA, MonteCarlo) are lightweight original implementations included in this package. Deep RL classes (DQN, PPO, A2C, SAC, etc.) are wrappers around stable-baselines3.
from ai_mk_toolkit import rl
# Tabular RL (included implementation)
ql = rl.QLearning(n_states=16, n_actions=4)
# Deep RL (stable-baselines3 wrapper, requires [rl] extra)
dqn = rl.DQN(policy="MlpPolicy", env=env)
sarsa = rl.SARSA(n_states=16, n_actions=4)
Computer Vision Tasks
The cv module provides task-oriented APIs that route to appropriate underlying models (e.g., ResNet, YOLO). These are task interfaces, not standalone model implementations.
from ai_mk_toolkit import cv
image_clf = cv.ImageClassification() # Routes to ResNet50
detector = cv.ObjectDetection() # Routes to YOLOv8
segmenter = cv.ImageSegmentation() # Routes to Mask R-CNN
๐ Model & Task Catalog
Note: The counts below include both unique model wrappers and task-level APIs. Some entries (e.g., Computer Vision tasks) are convenience interfaces that route to underlying models listed in other categories.
๐ Machine Learning โ 51 model wrappers (scikit-learn, XGBoost, LightGBM, CatBoost, UMAP): LinearRegression, Ridge, Lasso, ElasticNet, SVC, LogisticRegression, RandomForest, DecisionTree, XGBoost, LightGBM, CatBoost, KNN, PCA, TSNE, UMAP, and 36 more
๐ง Deep Learning โ 67 model wrappers (36 CNNs + 12 detectors + 8 sequence + 11 GANs): ResNet18/34/50/101/152, VGG16/19, MobileNetV2/V3, EfficientNetB0-B7, YOLOv5/v8/v9/v10, LSTM, GRU, GAN, StyleGAN, CycleGAN, WGAN, and more
๐ค NLP โ 54 entries (12 classical tools + 30 transformer models + 12 task pipelines): BERT (encoder), GPT-2 (causal), Llama 3 (causal), Mistral, T5 (seq2seq), Word2Vec, FastText, TFIDF, TextClassification, Summarization, and more
๐ฎ Reinforcement Learning โ 19 entries (5 tabular + 14 deep RL): QLearning, SARSA, ExpectedSARSA, MonteCarlo, TDLearning (tabular โ included implementations) + DQN, DoubleDQN, PPO, A2C, SAC, TD3, DDPG, TRPO (deep RL โ stable-baselines3 wrappers)
๐๏ธ Computer Vision โ 14 task APIs (routing interfaces to DL models above): ImageClassification, ObjectDetection, ImageSegmentation, PoseEstimation, OCR, FaceRecognition, ImageCaptioning, ImageGeneration, DepthEstimation, and more
See CHANGELOG.md for the detailed list.
๐๏ธ Architecture
ai_mk_toolkit/
โโโ ml/ # 51 scikit-learn / XGBoost / LightGBM / CatBoost wrappers
โโโ dl/ # Deep learning model wrappers (PyTorch / TensorFlow)
โโโ nlp/ # NLP model wrappers (NLTK, spaCy, Transformers)
โโโ rl/ # Tabular RL + stable-baselines3 wrappers
โโโ cv/ # Task-oriented computer vision APIs
โโโ core/ # Device detection, caching, logging, serialization
โโโ backends/ # PyTorch / TensorFlow / sklearn backend abstraction
โโโ automl/ # Hyperparameter search and model comparison
โโโ datasets/ # Built-in dataset loaders
โโโ preprocessing/ # Data transformation utilities
โโโ metrics/ # Evaluation metrics (classification, regression, clustering)
โโโ explainability/ # Feature importance, SHAP, LIME wrappers
โโโ visualization/ # Matplotlib-based plotting helpers
โโโ deployment/ # Model export (ONNX, TorchScript, SavedModel, joblib)
โโโ plugins/ # User-extensible model/dataset/metric registration
๐ง Advanced Usage
Unified Classifiers (scikit-learn backed)
from ai_mk_toolkit import UnifiedClassifier
clf = UnifiedClassifier(model="svc", kernel="rbf")
clf.fit(X_train, y_train)
print(clf.backend_name)
Deep Learning with Backend Selection
from ai_mk_toolkit import UnifiedModel
model = UnifiedModel(backend="pytorch")
model.add_dense(128, activation="relu")
model.compile(task="classification")
model.fit(X_train, y_train, epochs=10)
predictions = model.predict(X_test)
โ Quality Assurance
- Static Analysis: Ruff is used to continuously check for unused imports (F401) and unused variables (F841). Current status: all checks passing.
- Comprehensive Testing: 89 tests passing (framework-specific tests included). Full coverage of core functionality.
- Build & Packaging: Passes PyPI validation via twine. Builds successfully for both sdist and wheel distributions.
- Wrapper Architecture: No algorithm reimplementations. Pure interface layer over open-source libraries.
- Dependencies: Core dependencies auto-installed; optional extras available for specialized domains.
โ๏ธ License & Attribution
AI_MK_Toolkit itself is released under the MIT License.
The underlying libraries have their own licenses:
| Library | License |
|---|---|
| numpy, scikit-learn | BSD |
| torch, torchvision | BSD |
| tensorflow | Apache 2.0 |
| transformers, sentence-transformers | Apache 2.0 |
| xgboost, lightgbm, catboost | Apache 2.0 |
| nltk, spacy | Apache 2.0 |
| gensim | LGPL-2.1+ |
| ultralytics | AGPL-3.0 |
| stable-baselines3, sb3-contrib | MIT |
Important: Some optional dependencies (e.g.,
ultralyticsunder AGPL-3.0,gensimunder LGPL-2.1+) have copyleft license terms. Users are responsible for complying with the licenses of the optional dependencies they choose to install. If your project requires only permissive licenses, avoid installing the[cv]and[nlp]extras, or review individual package licenses before use.
See LICENSE_AND_ATTRIBUTION.md for full details.
๏ฟฝ Testing
pytest # All tests
pytest -v # Verbose
pytest tests/test_classical_models.py # Specific test
๐ Contributing
Found a bug? Want to contribute? See CONTRIBUTING.md for guidelines.
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 ai_mk_toolkit-0.5.1.tar.gz.
File metadata
- Download URL: ai_mk_toolkit-0.5.1.tar.gz
- Upload date:
- Size: 64.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aeac9588a3ab27a37e4bac4b852d0f7723499efad4cb45a4b753bca35428524
|
|
| MD5 |
e3adeefa0faf40951cd62209fb70f801
|
|
| BLAKE2b-256 |
522e9f22119b882a7b56b4f1a93928a7153a7168a7926033d367d6840a39d4fa
|
File details
Details for the file ai_mk_toolkit-0.5.1-py3-none-any.whl.
File metadata
- Download URL: ai_mk_toolkit-0.5.1-py3-none-any.whl
- Upload date:
- Size: 66.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b25da7ca2fadfc72dfaeb74735a8650c15df9ddbf0c72238bc6500aeefda9427
|
|
| MD5 |
9c0797363082f951ac067e3e8844ffcd
|
|
| BLAKE2b-256 |
02cc60152c7c7486206369f854d437b62416327c3fc0a169570e89ab246cf15e
|