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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycodeml-0.0.10.tar.gz
  • Upload date:
  • Size: 4.1 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.10.tar.gz
Algorithm Hash digest
SHA256 1583437c4df60b7a4320417854f5b8f69f92bb0c2bc32143f54dc9803af24383
MD5 10fca476838fd4098db9bcf78ea72660
BLAKE2b-256 54c2879c376dcdfb087ab764861122916f72b3425945d7003d8b99e8da387878

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodeml-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 4.1 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a1bb247c64034fea23b04ae5919f05e9fced99b4c357acbe51152457af305a24
MD5 4d494a1a82f07eb885242e0d74dce167
BLAKE2b-256 5d1c7052b5e643933cadc1420e6ca7a7ca3b5df6a0afa08c90b28f21aaa3c32d

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