Metadata-Version: 2.4
Name: cosmicml
Version: 0.1.0
Summary: From raw data to model insights — for Earth and beyond.
Author-email: Deepali Madala <deepalimadala@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Deepali
        
        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.
        
Project-URL: Homepage, https://github.com/Deepali-07/cosmicml
Project-URL: Documentation, https://github.com/Deepali-07/cosmicml#readme
Project-URL: Issues, https://github.com/Deepali-07/cosmicml/issues
Keywords: machine learning,astrophysics,space,preprocessing,shap,xgboost
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21
Requires-Dist: pandas>=1.3
Requires-Dist: scikit-learn>=1.0
Requires-Dist: matplotlib>=3.4
Requires-Dist: shap>=0.41
Provides-Extra: astronomy
Requires-Dist: astropy>=5.0; extra == "astronomy"
Provides-Extra: imbalance
Requires-Dist: imbalanced-learn>=0.9; extra == "imbalance"
Provides-Extra: xgboost
Requires-Dist: xgboost>=1.6; extra == "xgboost"
Provides-Extra: lightgbm
Requires-Dist: lightgbm>=3.3; extra == "lightgbm"
Provides-Extra: all
Requires-Dist: astropy>=5.0; extra == "all"
Requires-Dist: imbalanced-learn>=0.9; extra == "all"
Requires-Dist: xgboost>=1.6; extra == "all"
Requires-Dist: lightgbm>=3.3; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=3.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Dynamic: license-file

# 🌌 cosmicml

> *From raw data to model insights — for Earth and beyond.*

[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://python.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![PyPI](https://img.shields.io/badge/pypi-cosmicml-orange)](https://pypi.org/project/cosmicml)

A Python toolkit for ML practitioners and space data enthusiasts. `cosmicml` handles the full pipeline — data loading, preprocessing, model benchmarking, and SHAP explainability — in clean, importable modules.

Built by [@Deepali-07](https://github.com/Deepali-07) — ML Engineer & Astrophysics enthusiast.

---

## ✨ Features

| Module | What it does |
|---|---|
| `DataLoader` | Load CSV, JSON, HDF5, and FITS (astronomy) files |
| `DataSplitter` | Stratified train/val/test splitting |
| `DataCleaner` | Imputation, outlier clipping, label encoding |
| `SmartScaler` | Standard/MinMax/Robust scaling with `.revert()` |
| `DataBalancer` | SMOTE, ADASYN, undersampling, SMOTEENN |
| `ModelBenchmarker` | Run N models → ranked comparison table |
| `HyperparamTuner` | GridSearch / RandomSearch wrapper |
| `SHAPExplainer` | One-line SHAP summary, beeswarm, waterfall |
| `ModelReporter` | Auto-generate clean model performance report |
| `timer` | Decorator to time any function |
| `TimeIt` | Context manager for timing code blocks |

---

## 🚀 Installation

```bash
pip install cosmicml

# With all optional extras
pip install cosmicml[all]

# Astronomy FITS support only
pip install cosmicml[astronomy]
```

---

## ⚡ Quick Start

```python
from cosmicml import (
    DataCleaner, SmartScaler, DataBalancer,
    ModelBenchmarker, SHAPExplainer, ModelReporter
)
from cosmicml.data.splitter import DataSplitter

# 1. Split
splitter = DataSplitter(test_size=0.2, val_size=0.1, stratify=True)
X_train, X_val, X_test, y_train, y_val, y_test = splitter.split(X, y)

# 2. Clean
cleaner = DataCleaner(strategy="median", outlier_method="iqr")
X_train = cleaner.fit_transform(X_train)
X_test  = cleaner.transform(X_test)

# 3. Scale
scaler = SmartScaler(method="standard")
X_train = scaler.fit_transform(X_train)
X_test  = scaler.transform(X_test)

# 4. Balance
balancer = DataBalancer(strategy="smote")
X_train, y_train = balancer.fit_resample(X_train, y_train)

# 5. Benchmark
bench = ModelBenchmarker(task="classification")
print(bench.run(X_train, y_train, X_test, y_test))

# 6. Explain
explainer = SHAPExplainer(bench.best_model_, X_train)
explainer.summary(X_test)

# 7. Report
reporter = ModelReporter(bench.best_model_, task="classification")
reporter.report(X_test, y_test)
```

---

## 🔭 Astronomy / FITS Support

```python
from cosmicml import DataLoader

loader = DataLoader("observations.fits")
df = loader.load()  # Returns a clean pandas DataFrame
```

---

## 📁 Project Structure

```
cosmicml/
├── data/           # DataLoader, DataSplitter
├── preprocess/     # DataCleaner, SmartScaler, DataBalancer
├── training/       # ModelBenchmarker, HyperparamTuner
├── explainability/ # SHAPExplainer, ModelReporter
└── utils/          # logger, timer
```

---

## 🤝 Contributing

Pull requests are welcome! Please open an issue first to discuss what you'd like to change.

```bash
git clone https://github.com/Deepali-07/cosmicml
cd cosmicml
pip install -e ".[dev]"
pytest tests/
```

---

## 📄 License

MIT © [Deepali](https://github.com/Deepali-07)
