A lightweight automated ML pipeline for preprocessing, training, and evaluation.
Project description
EasyMLTool
Overview
EasyMLTool is a lightweight, automated machine learning pipeline package designed to simplify the entire ML workflow—from data preprocessing and model training to hyperparameter tuning, evaluation, and deployment. Its modular architecture makes it accessible for beginners while offering enough flexibility and extensibility for advanced users. With EasyMLTool, you can build robust machine learning models quickly and efficiently.
Features
- Automated Data Preprocessing
- Handles missing values, feature scaling, encoding, and splitting via scikit-learn pipelines and column transformers.
- Multiple Model Support
- Offers a variety of built-in traditional ML models (e.g., RandomForest, SVM, Logistic Regression) as well as deep learning models (e.g., LSTM, CNN, and PyTorch-based models).
- Hyperparameter Optimization
- Integrated methods (e.g., GridSearchCV) to automatically tune model parameters.
- Model Evaluation & Testing
- Includes utilities for model evaluation using metrics such as accuracy, F1-score, and more.
- Comes with comprehensive unit and integration tests.
- Easy Deployment
- Provides deployment utilities (via Flask) to quickly serve models as APIs.
- Lightweight & Modular Design
- Clean, modular codebase that facilitates easy integration into various ML workflows.
- Extensible
- Easily extend or customize components to fit your specific use case.
Installation
You can install EasyMLTool directly from PyPI:
pip install easymltool
Alternatively, if you want to install from source:
git clone https://github.com/FAbdullah17/EasyMLTool.git
cd EasyMLTool
pip install .
Usage
Below are several examples to get you started.
1. Importing EasyMLTool
from easymltool.data_preprocessing import DataPreprocessor
from easymltool.models import ModelBuilder, DeepLearningModels
from easymltool.training import Trainer, DeepTrainer, PyTorchTrainer
2. Data Preprocessing
import pandas as pd
from sklearn.datasets import make_classification
# Generate a synthetic dataset
X, y = make_classification(n_samples=500, n_features=10, random_state=42)
df = pd.DataFrame(X, columns=[f'feature_{i}' for i in range(10)])
df['target'] = y
# Preprocess the data
preprocessor = DataPreprocessor(numerical_strategy="mean", categorical_strategy="most_frequent", scaling_method="standard")
X_processed = preprocessor.fit_transform(df.drop(columns=['target']))
3. Training a Traditional ML Model
trainer = Trainer(model_name="random_forest", hyperparameter_tuning=False)
trained_model = trainer.train(X_processed, df['target'])
predictions = trained_model.predict(X_processed[:5])
print("Predictions:", predictions)
4. Training a Deep Learning Model
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X_processed, df['target'], test_size=0.2, random_state=42)
dl_trainer = DeepTrainer(input_shape=X_train.shape[1], model_type="lstm", epochs=50, batch_size=32)
trained_dl_model = dl_trainer.train(X_train, y_train, X_test, y_test)
5. Saving and Loading Models
dl_trainer.save_model("model.h5")
loaded_model = dl_trainer.load_model("model.h5")
6. Deploying a Model
python easymltool/deployment.py
Project Structure
EasyMLTool/
│── easymltool/
│ ├── __init__.py
│ ├── data_preprocessing.py
│ ├── deployment.py
│ ├── models.py
│ ├── training.py
│ ├── utils.py
│── examples/
│ ├── example_dl.ipynb
│ ├── example_ml.ipynb
│── test/
│ ├── __init__.py
│ ├── test_data_preprocessing.py
│ ├── test_models.py
│ ├── test_training.py
│── .gitignore
│── LICENSE
│── pyproject.toml
│── README.md
│── requirements.txt
│── setup.py
Contributing
We welcome contributions! If you'd like to contribute:
- Fork the repository.
- Create a new feature branch:
git checkout -b feature-your-feature
- Commit your changes:
git commit -m "Describe your changes"
- Push to your branch:
git push origin feature-your-feature
- Open a Pull Request on GitHub.
Testing
To run the tests, execute:
pytest test/
Deployment
To deploy a trained model:
python easymltool/deployment.py
Use an API client (e.g., Postman) to send POST requests to the API endpoint and retrieve predictions.
License
This project is licensed under the MIT License.
Contact
For questions, suggestions, or support, please contact Fahad Abdullah:
- Email: fahadai.co@gmail.com
- GitHub: FAbdullah17
- LinkedIn: Fahad Abdullah
Acknowledgments
Special thanks to the open-source community for providing the foundational libraries (such as scikit-learn, TensorFlow, and PyTorch) that made EasyMLTool possible.
Happy Coding with EasyMLTool! 🚀
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 easymltool-0.1.0.tar.gz.
File metadata
- Download URL: easymltool-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e192659aa80be651cf549fad5650b607495c9868f0a4ca35234adb6a92243ed
|
|
| MD5 |
9e60abdfce256ae4df29da0b158a8ac3
|
|
| BLAKE2b-256 |
f0ab80cd573389a65af31552f1aeab1ef76de4dc11837c6da7bf4820db9b5a17
|
File details
Details for the file EasyMLTool-0.1.0-py3-none-any.whl.
File metadata
- Download URL: EasyMLTool-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4674f3bd32e316c49b8c010fc5d0375a2dcfceb6b08fe9b9a2ec62b4dc455718
|
|
| MD5 |
1e1103560fab6de6addcd076ae8bdad7
|
|
| BLAKE2b-256 |
fcacb303cc154d31fff9159f048075ab9f175574e21c3e9ad3841ee12cda729a
|