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.20.tar.gz (8.4 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.20-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycodeml-0.0.20.tar.gz
  • Upload date:
  • Size: 8.4 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.20.tar.gz
Algorithm Hash digest
SHA256 c45adafa6a36bc7abb6d4dcbdb79595462875b42fb16ba67d309d296faeb31b6
MD5 9e7b8203b175675c88a4ac7124290ed8
BLAKE2b-256 8521cc03d6505653050369b4b17d1a145f7ed87889451069bdbefce8ec0db0c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodeml-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 9.2 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.20-py3-none-any.whl
Algorithm Hash digest
SHA256 76996d52bb472ff451c5aa7462f91a7666e3a3180a5db57d3ead2db96dcc5fc5
MD5 167702f46e27684402c88f4038f6dbe0
BLAKE2b-256 d895cf96571544fb511eabb3be68b8edba59572d7e7866e3a1f37d71595e09e9

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