Automatically train multiple regression models and return the best one.
Project description
PyCodeml
PyCodeml is a Python package designed to automate the training, evaluation, and selection of the best-performing machine learning models for regression and classification tasks. It simplifies the process of model training, comparison, and deployment.
Features
✅ Supports Regression and Classification tasks
✅ Evaluates multiple models and selects the best one
✅ Saves and loads trained models for future use
✅ Simple and intuitive API
Installation
You can install PyCodeml using pip:
pip install pycodeml
Usage
1️⃣ Train and Save the Best Model
import pandas as pd
from PyCodeml.regressor import RegressorTrainer # For regression tasks
# Load dataset from a CSV file (Ensure "target" column exists) you can give another name to target col
df = pd.read_csv("data.csv")
# Initialize and train the model
trainer = RegressorTrainer(df, "target")
best_model = trainer.train_and_get_best_model()
# Save the best model
trainer.save_best_model("best_model.pkl")
2️⃣ Load and Use the Saved Model
import pandas as pd
import numpy as np
from PyCodeml.utils import load_model
# Load the saved model
model = load_model("best_model.pkl")
# Load new data from a CSV file (without target column)
new_data = pd.read_csv("new_data.csv")
# Ensure the new data has the same feature columns as the training data
# (Make sure "new_data.csv" has the same structure as the training dataset)
prediction = model.predict(new_data)
# Print the predictions
print("Predicted Values:", prediction)
Supported Models
Regression
- Linear Regression
- Decision Tree Regressor
- Random Forest Regressor
- Support Vector Machine (SVR)
- Gradient Boosting Regressor
- Ridge Regression
- Lasso Regression
- Elastic Net
Classification (Coming Soon)
- Logistic Regression
- Random Forest Classifier
- Support Vector Machine (SVM)
- Gradient Boosting Classifier
- K-Nearest Neighbors (KNN)
Contributing
Contributions are welcome! If you’d like to improve this package, feel free to fork the repository and submit a pull request.
https://github.com/Nachiket858/PyCodeML
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.11.tar.gz.
File metadata
- Download URL: pycodeml-0.0.11.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9a589a88d00ee7e2c34ed99f72f89f49492387318728fc8e2eabe25a4291b25
|
|
| MD5 |
bc8645dca400d75475efc20f708aa939
|
|
| BLAKE2b-256 |
0dbc499eb88de05eddd47eeb060c2fb63f4d089433eb53c56d0470ed6442123e
|
File details
Details for the file pycodeml-0.0.11-py3-none-any.whl.
File metadata
- Download URL: pycodeml-0.0.11-py3-none-any.whl
- Upload date:
- Size: 4.6 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 |
574ba452e084da2757cea0fd633814709c9944b0f8385239572ac85c03834797
|
|
| MD5 |
a0654e5f23b605777b82b19b2e511faa
|
|
| BLAKE2b-256 |
b6195b7b8c193fff000a14ec007f55eb18e3c2dd428231f026ad6fd13c29f1f6
|