Skip to main content

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


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.9.tar.gz (3.0 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.9-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pycodeml-0.0.9.tar.gz
Algorithm Hash digest
SHA256 914909c5d007e0913aa798c363967568a5167b9cc209beb042098ef2a6896fe0
MD5 8e138e93eec5a6049b57a6a34ca0c3e0
BLAKE2b-256 bfa8f4ac2583e625c63a3c66a820ffc2596462c87c4f149d1afacba421f5dca5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pycodeml-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 0d9b192257e54e15783b8f5375c31d87d6093ecece955738b4e0ebaec803e105
MD5 91676011c5f54bc46e09afec6b106d0c
BLAKE2b-256 29944423e19bad820d60e57742034e3cc622bf46af9b541b703db1e87d59db03

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