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
Release history Release notifications | RSS feed
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.0.5.tar.gz
(6.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lazybrains-0.0.5.tar.gz.
File metadata
- Download URL: lazybrains-0.0.5.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10631b94241c6fc473a12614e2a1056e529627568fdf135a6aba949f6873381b
|
|
| MD5 |
0455623677c12a5312c493342f886df7
|
|
| BLAKE2b-256 |
989b492350b4208858666b7a631ff3842feab890d9488fc79224a56864246662
|
File details
Details for the file lazybrains-0.0.5-py3-none-any.whl.
File metadata
- Download URL: lazybrains-0.0.5-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07107c062f029b1ccd32b904a362a621764ffe489717a5109e903a462432f82a
|
|
| MD5 |
d137ce10a5585cc560051edf7263dde4
|
|
| BLAKE2b-256 |
c648dd82a543c625c55d4b967dbd4a7c3b5cf0196e2eb2a8f6eb941dfb5555be
|