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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycodeml-0.0.12.tar.gz
  • Upload date:
  • Size: 4.7 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.12.tar.gz
Algorithm Hash digest
SHA256 b210e51cdc33db8e3981a756e9a770d92ab493cd6c830ed35b2411fa48a636df
MD5 f34417065a4fe7a9bd67236c2684c566
BLAKE2b-256 3ecc4000c4d772f7a6aa16660d4fd7e4fadedc7a767e9c6ed5b5d311e117f79d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodeml-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 cb2ba920fb935458e994c020e66ca758e28b193255bf06937056e1f6e7c45fd0
MD5 f00b9fbc17c5ee82a7e7dc4faeafa608
BLAKE2b-256 8275f6f2640d2bfa8e62b6683045a95fc006badfbe7dc9718f06ffcb5cd7002c

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