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
result = 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) -> object
model = result.model #now use model.predict
score = result.score #print score
classifier = result.classifier #print classifier to know the best algorithm name that's used
convertible_model = result.convertible_model #extracts the model only (no preprocessing)
preprocessedX = result.preprocessedX #extracts the x features after preprocessing
n_features = result.n_features #returns total number of the preprocessed x features
initial_type = result.initial_type #initial type needed to convert the model to .onnx
result.export_to_onnx() #dump the model as 'model.onnx' in your current working directory (Input name: 'input')
Metadata
Release files for batabyal 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| batabyal-1.2.2.tar.gz | 9.2 kB | Without provenance | Details for batabyal-1.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| batabyal-1.2.2-py3-none-any.whl | Python 3 | none | any | Details for batabyal-1.2.2-py3-none-any.whl |
Total release size: 17.8 kB
Release files / batabyal-1.2.2.tar.gz
| Download URL | batabyal-1.2.2.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ae2b04998f79bb472a58611618180c881924b7387eca83ab31a974d5f471b1a
|
|
BLAKE2b-256 checksum How to use checksums |
836e4e243606e3c64274ee3d811bba9369b9909497f22f1844aac680b8a416ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / batabyal-1.2.2-py3-none-any.whl
| Download URL | batabyal-1.2.2-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97698a2ee4c4ebd83b9cb74ec7bb45028522601fce41b4fbba4258c616e80aa8
|
|
BLAKE2b-256 checksum How to use checksums |
77e0a19e25dbe3a5b237af8b8cedd80b3b9d4e59aabd43a25a9d50f878d9c9dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for batabyal 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.