Metadata-Version: 2.4
Name: krishnautoml
Version: 1.0.4
Summary: Beginner-friendly AutoML library for tabular data
Author: Krish
Author-email: Krishna <krishnatyagi2526@gmail.com>
License: MIT License
        
        Copyright (c) 2025 knight22-21
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: scikit-learn
Requires-Dist: matplotlib
Requires-Dist: seaborn
Requires-Dist: jinja2
Requires-Dist: joblib
Requires-Dist: optuna
Requires-Dist: optuna-integration[lightgbm]
Provides-Extra: xgboost
Requires-Dist: xgboost; extra == "xgboost"
Provides-Extra: lightgbm
Requires-Dist: lightgbm; extra == "lightgbm"
Provides-Extra: catboost
Requires-Dist: catboost; extra == "catboost"
Dynamic: author
Dynamic: license-file
Dynamic: requires-python

# KrishnAutoML

[![PyPI version](https://img.shields.io/pypi/v/krishnautoml.svg)](https://pypi.org/project/krishnautoml/)
[![Build Status](https://github.com/knight22-21/KrishnAutoML/actions/workflows/ci.yaml/badge.svg)](https://github.com/knight22-21/KrishnAutoML/actions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

**KrishnAutoML** is a lightweight, beginner-friendly, and production-ready **AutoML library** for **tabular data**.  
It automates the end-to-end machine learning workflow with **minimal user input**, while keeping things modular and extensible.

---

## Features

- Load data from CSV or Pandas DataFrame  
- Automatic problem type detection (classification or regression)  
- Smart preprocessing (missing values, categorical encoding, scaling)  
- Optional EDA reports for insights  
- Train multiple models (LightGBM, XGBoost, CatBoost, Scikit-Learn)  
- Automated model selection and hyperparameter tuning (Optuna / GridSearchCV)  
- Flexible cross-validation (KFold, StratifiedKFold, GroupKFold)  
- Multiple evaluation metrics dynamically  
- Early stopping and GPU support  
- Save models + reproducible pipeline code  
- Auto-generated reports in HTML/Markdown  

---

## Installation

From PyPI (after publishing):
```bash
pip install krishnautoml
````

From source:

```bash
git clone https://github.com/knight22-21/KrishnAutoML.git
cd KrishnAutoML
pip install -e .[dev]
```

---

## Quick Start

### Python API

```python
from krishnautoml import KrishnAutoML

# Initialize AutoML
automl = KrishnAutoML(target="Survived", problem_type="auto")

# Full pipeline
(
    automl
    .load_data("data/titanic.csv")
    .preprocess()
    .train_models()
    .evaluate()
    .save_model("best_model.pkl")
)

print("Best model metrics:", automl.best_score)
```

### Command Line Interface (CLI)

```bash
krishnautoml fit --data data/titanic.csv --target Survived --report
```

This will:

* Train models
* Save `best_model.pkl`
* Generate an HTML performance report

---

## Example Output

**Metrics (Classification example):**

```python
{'accuracy': 0.8567, 'precision': 0.8421, 'recall': 0.8312, 'f1': 0.8350}
```

**Generated Report:**

* Confusion matrix
* Feature importance
* ROC-AUC curve
* Summary of preprocessing steps

---

## Advanced Usage

* Custom cross-validation:

```python
automl = KrishnAutoML(target="SalePrice", cv_strategy="KFold", n_splits=10)
```

* Specify metrics:

```python
automl = KrishnAutoML(target="Survived", metrics=["accuracy", "f1"])
```

* Load trained model:

```python
from joblib import load
model = load("best_model.pkl")
```

---

## Development

Clone and install dev dependencies:

```bash
git clone https://github.com/knight22-21/KrishnAutoML.git
cd KrishnAutoML
pip install -e .[dev]
```

Run tests:

```bash
pytest
```

Lint & format:

```bash
flake8 krishnautoml
black krishnautoml
```

---

## License

MIT License © 2025 \Krishna Tyagi

---

## Contributing

Contributions are welcome!

* Fork the repo
* Create a feature branch
* Submit a PR

---

## Acknowledgements

* [scikit-learn](https://scikit-learn.org)
* [XGBoost](https://xgboost.ai)
* [LightGBM](https://lightgbm.readthedocs.io)
* [CatBoost](https://catboost.ai)
* [Optuna](https://optuna.org)
