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
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 pycodeml-0.0.19.tar.gz.
File metadata
- Download URL: pycodeml-0.0.19.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04e9e5fa756005e99f837305b1cef21e8710d8793aa08b2f40cda8b3f749b646
|
|
| MD5 |
157cd2e954531406605330daff26f420
|
|
| BLAKE2b-256 |
02946b36b9323875bacaf1693d546a96a39df087ed2b152be1fac217fc107868
|
File details
Details for the file pycodeml-0.0.19-py3-none-any.whl.
File metadata
- Download URL: pycodeml-0.0.19-py3-none-any.whl
- Upload date:
- Size: 9.1 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 |
c3a1c269cc7ead87cfff3c9daf23dbdf2cb278b7e64c903c1755919dbf30ad6e
|
|
| MD5 |
38152fc7d9c28d119bd4692f2b575d25
|
|
| BLAKE2b-256 |
e76d0fd95ddb4ed4cc80c65a0419db48dc2e5a63540566253494cfe99d96cd4f
|