Skip to main content

Model Selection Tool

Project description

lazybrains

lazybrains is a simple model selection tool for linear regression, supporting OLS (Normal Equation), Batch Gradient Descent (BGD), and BGD with L1 regularization (Lasso). It is built on top of pandas and numpy.

Usage

1. Import and Prepare Data

import pandas as pd
from lazybrains import Lazy_Work

df = pd.read_csv("your_data.csv")
lm = Lazy_Work(df)

2. Split Data

lm.fit_data(
    random_state=42,
    ratio=0.8,
    training_features=['feature1', 'feature2'],
    target_features=['target']
)

3. Standardize Features (Optional)

lm.Standard_Scale(features=['feature1', 'feature2'])

4. Train Models

OLS (Normal Equation)

score = lm.doML(model="lr", method="ols", get_equation=True)
print("R2 Score:", score)

Batch Gradient Descent

score = lm.doML(model="lr", method="bgd", epochs=200, learning_rate=0.01, get_equation=True)
print("R2 Score:", score)

Lasso Regression (BGD + L1)

score = lm.doML(model="lr", method="bgd", penalty="l1", epochs=200, learning_rate=0.01, lamda_=0.1, get_equation=True)
print("R2 Score:", score)

5. Save/Load Model

lm.save_model(model_obj, filename="model.pkl")
loaded_model = lm.load_model(filename="model.pkl")

MIT


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

lazybrains-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazybrains-0.2.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file lazybrains-0.2.0.tar.gz.

File metadata

  • Download URL: lazybrains-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for lazybrains-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b9a660670ebb23f4469d8cdab3b345e26e131d7f5affe0004d42fac4750c90ff
MD5 cae548025bd9620f6f6c494794d8282d
BLAKE2b-256 5ab231f8a5d1b23dc639b0b9d651d6e2a547b01f4f25e0cbdf25e5a1a73583fe

See more details on using hashes here.

File details

Details for the file lazybrains-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lazybrains-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for lazybrains-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af6e7657ee752fd4dd70870734dd25b2262445215b35567d15f2ab62297d393b
MD5 e969b1d1e9f4eb439f2b4de8426d1461
BLAKE2b-256 3899f2ad34b31e5aef341538dcbfb4d90055405d78b6fb3a4b8c4cb7af38dd0a

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