Skip to main content

EasyMLTool

PyPI version License: MIT Python Version


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:

  1. Fork the repository.
  2. Create a new feature branch:
    git checkout -b feature-your-feature
    
  3. Commit your changes:
    git commit -m "Describe your changes"
    
  4. Push to your branch:
    git push origin feature-your-feature
    
  5. 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:


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! 🚀

Metadata

Release files for EasyMLTool 0.1.0

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

Source distribution (sdist)

Source distribution for EasyMLTool 0.1.0
File Size Uploaded Provenance Actions
easymltool-0.1.0.tar.gz 9.4 kB Without provenance Details for easymltool-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for EasyMLTool 0.1.0
File Interpreter ABI Platform Actions
EasyMLTool-0.1.0-py3-none-any.whl Python 3 none any Details for EasyMLTool-0.1.0-py3-none-any.whl

Total release size: 20.7 kB

Release files / easymltool-0.1.0.tar.gz

Download URL easymltool-0.1.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1e192659aa80be651cf549fad5650b607495c9868f0a4ca35234adb6a92243ed
BLAKE2b-256 checksum
How to use checksums
f0ab80cd573389a65af31552f1aeab1ef76de4dc11837c6da7bf4820db9b5a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / EasyMLTool-0.1.0-py3-none-any.whl

Download URL EasyMLTool-0.1.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4674f3bd32e316c49b8c010fc5d0375a2dcfceb6b08fe9b9a2ec62b4dc455718
BLAKE2b-256 checksum
How to use checksums
fcacb303cc154d31fff9159f048075ab9f175574e21c3e9ad3841ee12cda729a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for EasyMLTool 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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