Skip to main content

Data cleaning and automated ML model selection package

Project description

###Package: batabyal

batabyal is a lightweight Python package for Machine Learning utilities that provides:

  • cleaning_module - A CSV data cleaning module
  • trainer_kit - ML module for classification problems

Installation


Use the below command in the terminal

pip install batabyal

Importation


Import a specific thing or the entire module whatever is required

from batabyal import cleaning_module as cm
from batabyal.trainer_kit import TransformedTargetClassifier, autofit_classification_model

Usage


1. cleaning_module: It provides only one function clean_csv used for cleaning .csv datasets efficiently

cm.clean_csv('filename.csv', numericData, charData, True, True) 
#structure: clean_csv(file, numericData, charData, fill, case_sensitivity=False, dummies=None) -> pd.DataFrame
#If `fill==True`, it fills NaN in numeric columns with its mean. 
#if `case_sensitivity=True`, it will lowercase all labelled values.
#`dummies` are the list of values to replace with NaN before cleaning.

2. trainer_kit: It provides one wrapper class TransformedTargetClassifier for encoding and inversely transforming predictions to the original label and one function autofit_classification_model for autofitting classification models with the best algorithm and hyperparameters based on roc_auc_ovr_weighted score

model = TransformedTargetClassifier(classifier=svc, transformer=labelEncoder)
#let labelencoder and svc are from sklearn 
#you can now use model.fit() , model.predict() with raw labelled data, it will automate the encoding internally for training and prediction
#And model.predict() will return the original label by inversely transforming the encoded numbers back internally 

model, accuracy, algorithm_name = autofit_classification_model(x, y, "numeric", 3)
#structure: autofit_classification_model(x:pd.DataFrame, y:pd.DataFrame, x_type:Literal["numeric", "categorical", "mixed"], n_splits:int, cat_features:list[str]=[], whitelisted_algorithms:list[Literal["LogisticRegression", "DecisionTree", "RandomForest", "GaussianNB", "BernoulliNB", "CategoricalNB", "CatBoost", "XGBoost", "Ripper", "SVC", "KNN"]]|Literal["auto"]="auto", enable_votingClassifier:bool=True, random_state:int|None=42, verbosity:bool=True) -> tuple[ClassifierMixin, float, str]

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

batabyal-1.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

batabyal-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file batabyal-1.0.0.tar.gz.

File metadata

  • Download URL: batabyal-1.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for batabyal-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ce3ea523f200420a20164fbc7454e5a840fb893e23ab1be066d9c627768487e8
MD5 3352bf73d66bdc880c03cf3d7b1162a7
BLAKE2b-256 fdb5178688dd3ec15d47bb85d18922495eebb81f07a235c8b1b98f58ae84b939

See more details on using hashes here.

File details

Details for the file batabyal-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: batabyal-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for batabyal-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 038351bc7d5819857f7ff089963d374129a9d0e38f15413c26765fbfb0f833ea
MD5 a4657399948f0e6e2739ee30dc83c4ce
BLAKE2b-256 2df9316509bf0248235a8a0eacdd4bbfc3e44ec923f98abf779e41d201742fcb

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