A machine learning pipeline for preprocessing, model selection, and evaluation.
Project description
🧠 Brains Build Code - Automated Machine Learning Pipeline
Brains Build Code is an automated machine learning pipeline designed to simplify the end-to-end machine learning workflow. It handles:
- Data preprocessing
- Feature engineering
- Model selection
- Hyperparameter tuning
- Model evaluation
Built to save you time, reduce boilerplate, and accelerate experimentation.
Installation
From PyPI:
pip install brainsbuildcode
Directly from GitHub:
pip install git+https://github.com/achelousace/brainsbuildcode.git
📖 Usage
Full Build Example:
from brainsbuildcode import Brain
from sklearn.datasets import load_breast_cancer
import pandas as pd
# Load dataset
data = load_breast_cancer(as_frame=True)
df = data.frame
# Instantiate and build the model
best_model = Brain(df, target='target', model_name='RFC', grid_search=None)
best_model.build()
Alternative (Chainable Call):
from brainsbuildcode import Brain
from sklearn.datasets import load_breast_cancer
data = load_breast_cancer(as_frame=True)
df = data.frame
# Instantiate and immediately build
best_model = Brain(df, target='target', model_name='RFC', grid_search='cv').build()
Convert Function (Manual Data Preprocessing):
from brainsbuildcode import Brain
import seaborn as sns
import pandas as pd
# Load dataset
df = sns.load_dataset("titanic")
# Step 1: Instantiate
best_model = Brain(df, target='survived', model_name='RFC', grid_search=None, drop_duplicates=True)
# Step 2: Convert
X, y, ncol, ocol, ordinal_cols = best_model.convert(
df=df,
target=target,
ncol=[], # Specify numerical columns (optional)
ocol=[], # Specify categorical columns (optional)
ordinal_cols={}, # Specify ordinal columns (optional)
ord_threshold=0, # Auto-detect ordinal columns if unique categories <= threshold (0 disables auto-detection)
ordname=[], # Manually specify ordinal column names (optional)
drop_cols=[] # Columns to drop (optional)
)
# Now you can process `X`, `y`, `ncol`, `ocol`, `ordinal_cols` manually, or pass them back to `Brain`
💡 Key Features
-
Automatic Detection of numerical, categorical, and ordinal features.
-
Missing Value Handling with customizable strategies.
-
Feature Scaling & PCA Support.
-
Flexible Encoding: One-hot, label, ordinal.
-
Multiple Models Supported: Random Forest, XGBoost, Logistic Regression, SVC, etc.
-
Voting Classifiers & Ensemble Models.
-
Hyperparameter Optimization: Grid Search & Randomized Search.
-
Detailed Evaluation Metrics & Visualizations.
🔗 License This project is licensed under the MIT License.
🛠️ Contribution Feel free to contribute, suggest features, or report issues via pull requests and the issues section!
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
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 brainsbuildcode-1.0.2.tar.gz.
File metadata
- Download URL: brainsbuildcode-1.0.2.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe8e5ed4cbcfdc9c73321cb31f2384a0fac9bb37f4a07709854d85de1dd7fbbd
|
|
| MD5 |
24496526f6ff9d0aa208db80655ae997
|
|
| BLAKE2b-256 |
f3f54d2e95f2a95f711b23f817566bf25d97b07fd90982588108420ba7ab9dd8
|
File details
Details for the file brainsbuildcode-1.0.2-py3-none-any.whl.
File metadata
- Download URL: brainsbuildcode-1.0.2-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43fadf9ee6720176fb3aed4aac0edfe6d97933764bffa054f8fb63abc7e62d4e
|
|
| MD5 |
63225d2d7c1542b09134ca6f876f4641
|
|
| BLAKE2b-256 |
9f17c103a51f43a53edef4a3946c1b310d57b55db969a77d6174e60e021d4f9f
|