Skip to main content

Automatically train multiple regression models and return the best one.

Project description

Got it! Here's the full README.md as one continuous markdown block, without unnecessary spacing between sections — just like your screenshot style.

# PyCodeML
**PyCodeML** is a Python package designed to automate the training, evaluation, tuning, and selection of the best-performing machine learning models for regression, classification, and clustering tasks. It simplifies the process of model training, comparison, tuning, and deployment.

## ✅ Features
- Supports **Regression**, **Classification**, and **Clustering** tasks  
- Evaluates multiple models and selects the best one  
- **Hyperparameter tuning** support for optimized performance  
- Saves and loads trained models for future use  
- Simple and intuitive API for fast prototyping and deployment  
## 📦 Installation

pip install PyCodeML

💻 Usage

1️⃣ Train and Save the Best Regression Model

import pandas as pd
from PyCodeML.regressor import RegressorTrainer  # For regression tasks

df = pd.read_csv("data.csv")

trainer = RegressorTrainer(df, "target", data_sample_percent=100)
best_model = trainer.train_and_get_best_model()

trainer.save_best_model("best_regression_model.pkl")

2️⃣ Train and Save the Best Classification Model

import pandas as pd
from PyCodeML.classifire import ClassifierTrainer  # For classification tasks

df = pd.read_csv("classification_data.csv")

trainer = ClassifierTrainer(df, "label", data_sample_percent=100)
best_model = trainer.train_and_get_best_model()

trainer.save_best_model("best_classifier_model.pkl")

3️⃣ Tune the Best Regression Model

from PyCodeML.tunner import RegressorTuner

tuner = RegressorTuner(
    dataset=df,
    target_column="target",
    model_name="Random Forest"  # Must match one of the supported models
)

tuned_model, score = tuner.tune()

4️⃣ Tune the Best Classification Model

from PyCodeML.tunner import ClassifierTuner

tuner = ClassifierTuner(
    dataset=df,
    target_column="label",
    model_name="Random Forest Classifier"
)

tuned_model = tuner.tune()

5️⃣ Train and Save the Best Clustering Model

import pandas as pd
from PyCodeML.clustering import ClusteringTrainer

df = pd.read_csv("unsupervised_data.csv")

trainer = ClusteringTrainer(df, n_clusters=3, data_sample_percent=100)
best_model = trainer.train_and_get_best_model()

trainer.save_best_model("best_clustering_model.pkl")

6️⃣ Load and Use the Saved Model

import pandas as pd
from PyCodeML.utils import load_model

model = load_model("best_model.pkl")

new_data = pd.read_csv("new_data.csv")
predictions = model.predict(new_data)

print("Predicted Values:", predictions)

7️⃣ Label Data Using Clustering

labeled_df = trainer.label_data()
print(labeled_df.head())

📊 Supported Models

Regression

  • Linear Regression
  • Decision Tree Regressor
  • Random Forest Regressor
  • Support Vector Regressor (SVR)
  • Gradient Boosting Regressor
  • Ridge Regression
  • Lasso Regression
  • Elastic Net

Classification

  • Logistic Regression
  • Random Forest Classifier
  • Support Vector Machine (SVM)
  • Decision Tree Classifier
  • Gradient Boosting Classifier
  • K-Nearest Neighbors (KNN)

Clustering

  • KMeans
  • DBSCAN
  • Agglomerative Clustering

🤝 Contributing

Contributions are welcome! If you'd like to improve this package, feel free to fork the repository and submit a pull request.

🔗 GitHub

https://github.com/Nachiket858/PyCodeML

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycodeml-0.0.18.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycodeml-0.0.18-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pycodeml-0.0.18.tar.gz.

File metadata

  • Download URL: pycodeml-0.0.18.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for pycodeml-0.0.18.tar.gz
Algorithm Hash digest
SHA256 44fa4b680aacedd18a5232efc070db3ba254f96f818377589c3b235a881be66c
MD5 e663f8ea006c917f6dd2feca47ef434d
BLAKE2b-256 7bfd236b57b0b3c588ddeb2a8f1ef5878ebb1aea40539601a601831bae09bf45

See more details on using hashes here.

File details

Details for the file pycodeml-0.0.18-py3-none-any.whl.

File metadata

  • Download URL: pycodeml-0.0.18-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for pycodeml-0.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 5ea8d7547b607bc5ac230f545eeaf0fa1dc5cf6d28de1340df6141ec5776dc1c
MD5 8df2b014646420f45ab1314c9ff69d7b
BLAKE2b-256 c5660d68f1b4742d3d89727e05439baed7fc8062329c92bad8eb75b2b351c4bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page