Skip to main content
Author Profile

Chokkhu

An End-to-End, Research-Grade ML and Data Science Pipeline Toolkit for Tabular and Computer Vision Datasets.

PyPI version Python versions Build Status License: MIT

"Minimalistic Code. Maximum Output. Zero Heavy Dependencies."


Overview

Chokkhu is a high-performance Python toolkit designed to streamline the complete Machine Learning lifecycle including raw data loading, statistical Exploratory Data Analysis, advanced data cleaning, preprocessing, feature transformation, and stratified data splitting.

Core Philosophy and Design Principles

  1. Zero Heavy Dependencies: Built from the ground up using pure NumPy, Pandas, SciPy, Matplotlib, Seaborn, and OpenCV-headless. No Torch, TensorFlow, Scikit-Learn, or imbalanced-learn dependencies required.
  2. Unified Minimalist API: Powerful operations encapsulated in intuitive, one-line functions (load, eda, clean, preprocess, transform, split).
  3. Cross-Platform Compatibility: Tested and verified across 10 environments (Python 3.8 to 3.12 on Linux Ubuntu and Windows).

Installation

Install Chokkhu directly from PyPI via pip:

pip install --upgrade chokkhu

Complete End-to-End Pipeline in One Workflow

import chokkhu as ck

df = ck.load("dataset.csv")

ck.eda.tabular("dataset.csv", target_col="price", save_reports=True)

df_clean = ck.clean(
    df,
    missing="knn",
    outliers="isolation_forest",
    duplicates=True,
    fix_data_types=True
)

df_proc, state = ck.preprocess(
    df_clean,
    target="price",
    scale="standard",
    encode="onehot",
    select_features="correlation"
)

df_trans = ck.transform(
    df_proc,
    target="price",
    resample="smote",
    pca=10
)

X_tr, X_val, X_te, y_tr, y_val, y_te = ck.split(
    df_trans,
    target="price",
    test_size=0.2,
    val_size=0.1,
    stratify=True,
    random_state=42
)

Detailed API Reference

1. Data Loading (chokkhu.load)

Auto-detects file format and loads tabular or image datasets seamlessly:

import chokkhu as ck

df = ck.load("data.csv")

images_data = ck.load("images_folder/", data_type="image", target_size=(128, 128))

2. Exploratory Data Analysis (chokkhu.eda)

Tabular EDA

Generates univariate, bivariate, and multivariate statistical reports with interactive visualizations:

ck.eda.tabular(
    dataset_path="data.csv",
    target_col="target",
    save_reports=True,
    save_dir="./eda_reports"
)

Image EDA

Analyzes resolution distributions, color spaces, blur scores (Laplacian variance), pure NumPy Shannon entropy, SNR, edge intensity, and perceptual duplicates:

ck.eda.image(
    dataset_path="dataset_images/",
    save_reports=True,
    save_dir="./image_reports"
)

3. Data Cleaning (chokkhu.clean)

All-in-one data sanitation function:

df_cleaned = ck.clean(
    data=df,
    missing="knn",
    missing_threshold=0.5,
    outliers="iqr",
    outlier_action="remove",
    duplicates=True,
    fix_data_types=True
)

4. Data Preprocessing (chokkhu.preprocess)

Stateful feature scalers, encoders, and feature selection:

df_processed, preprocessor_state = ck.preprocess(
    data=df_cleaned,
    target="target_column",
    scale="standard",
    encode="onehot",
    select_features="mutual_info",
    top_k_features=15
)

5. Data Transformation (chokkhu.transform)

Dimensionality reduction, class imbalance resampling, polynomial feature engineering, and image augmentations:

df_transformed = ck.transform(
    data=df_processed,
    target="target_column",
    pca=5,
    lda=2,
    tsne=2,
    resample="smote",
    polynomial=2,
    log_features=["skewed_col"]
)

aug_images_dict = ck.transform(
    data=images_data,
    augment=True,
    augment_techniques=["horizontal_flip", "rotate", "brightness", "contrast", "noise", "crop", "blur", "cutout"],
    augment_factor=3
)

6. Data Splitting (chokkhu.split)

Multi-way stratified partitioning and cross-validation generators:

X_train, X_test, y_train, y_test = ck.split(
    df_transformed,
    target="target_column",
    test_size=0.2,
    stratify=True,
    random_state=42
)

X_train, X_val, X_test, y_train, y_val, y_test = ck.split(
    df_transformed,
    target="target_column",
    test_size=0.2,
    val_size=0.1,
    stratify=True,
    random_state=42
)

for fold, (train_df, val_df) in enumerate(ck.split(df, method="kfold", n_splits=5)):
    print(f"Fold {fold}: Train shape={train_df.shape}, Val shape={val_df.shape}")

Feature Matrix Summary

Category Modules & Algorithms Available
I/O CSV, TSV, JSON, Excel (.xlsx), Parquet, NumPy (.npy, .npz), Image Folders
EDA Univariate, Bivariate, Multivariate Correlation, Interactive HTML Reports, Image Quality & Blur Metrics, GLCM Texture, Perceptual Duplicates
Cleaning KNN Imputer, MICE (Iterative), Tukey IQR, Isolation Forest, Z-Score, Winsorization, Auto Dtype Fixer
Preprocessing Standard, MinMax, Robust, Power, Quantile Scalers; One-Hot, Target, Binary, Frequency Encoders; Variance, Correlation, Mutual Info, RFE Selectors
Transformation PCA, SVD, LDA, t-SNE, SMOTE, ADASYN, Tomek Links, Image Augmentation (Flip, Rotation, Brightness, Noise, Crop, Blur, Cutout, Mixup), Polynomial Features
Splitting Train/Test, Train/Val/Test (3-way), Stratified Splitting, K-Fold, Stratified K-Fold, TimeSeriesSplit

Contributing

We welcome community contributions! Feel free to submit issues or pull requests to help expand Chokkhu:

  1. Fork the Repository
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more details.

Metadata

Release files for chokkhu 0.6.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chokkhu 0.6.7
File Size Uploaded
chokkhu-0.6.7.tar.gz 47.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chokkhu 0.6.7
File Interpreter ABI Platform
chokkhu-0.6.7-py3-none-any.whl Python 3 none any Details

Total release size: 108.3 kB

Release files / chokkhu-0.6.7.tar.gz

Download URL chokkhu-0.6.7.tar.gz
Size 47.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7d5a00bccf8ac7e6c0aa9c54de52a814d7cb75e1df9ae3aa332654a96f8c6ecc
BLAKE2b-256 checksum
How to use checksums
d6e5eb9b7b875c0176cb511cc3eb2182f77594af11f67b5c3d1309422255f026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / chokkhu-0.6.7-py3-none-any.whl

Download URL chokkhu-0.6.7-py3-none-any.whl
Size 60.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd808c5c7c83a13fb5f4154cd5d5b9f987c7c52a08beee38123f0e200c6bbeab
BLAKE2b-256 checksum
How to use checksums
bf6316d765156edcc57b38fcb2ed3ed239c00c20bf17e59375a276951482eb6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.6.0

2 release files

1.5.21

2 release files

1.5.20

2 release files

1.5.19

2 release files

1.5.18

2 release files

1.5.17

2 release files

1.5.16

2 release files

1.5.15

2 release files

1.5.14

2 release files

1.5.13

2 release files

1.5.12

2 release files

1.5.11

2 release files

1.5.10

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

This release

0.6.7 This release

2 release files

0.5.2

2 release files

0.3.42

2 release files

0.3.41

2 release files

0.3.40

2 release files

0.3.39

2 release files

0.3.38

2 release files

0.3.37

2 release files

0.3.36

2 release files

0.3.35

2 release files

0.3.34

2 release files

0.3.33

2 release files

0.3.32

2 release files

0.3.31

2 release files

0.3.30

2 release files

0.3.29

2 release files

0.3.28

2 release files

0.3.27

2 release files

0.3.26

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page