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", data_sample_percent=100)   
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.13.tar.gz (5.3 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.13-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycodeml-0.0.13.tar.gz
  • Upload date:
  • Size: 5.3 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.13.tar.gz
Algorithm Hash digest
SHA256 b84aad5e641e4473f75faf56b1345c92d12bd600b97f4e7ee61c5f29a8217048
MD5 b966f3442ec516a8c27b21cc8c13cc00
BLAKE2b-256 878c64efbf5af408048dd2994d87702945447846ac43cd70fb4013513189c0e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodeml-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 1ecc040a7e9611ec716e3e6d35fbeade4389c1acbd4218e174a1c5efb81e701c
MD5 5bb85c4f1e2bfca7b72ae4aafb1969a6
BLAKE2b-256 65f12a18f802947c6e160a2b3db48c7edfcbc0096e8770754c09783b6eac331c

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