Metadata-Version: 2.1
Name: gesund
Version: 0.2.1
Summary: A CRO platform for clinical-grade AI Train. Validate. Secure clearance. Gesund.ai orchestrates the AI as-a-Medical Device lifecycle, providing privacy-centered access to diverse yet standardized medical data sources, and a unique analytical toolbox that fosters clinical validation, regulatory clearance and effective marketing
Author-email: Veysel Koccaman <veysel@gesund.ai>, Hammad Khalid <hammad@gesund.ai>, Akson Varghese <akson@gesund.ai>, Ozkan Uysal <ozkan@gesund.ai>
Maintainer-email: Hammad Khalid <hammad@gesund.ai>, Akson Varghese <akson@gesund.ai>, Ozkan Uysal <ozkan@gesund.ai>
Project-URL: Homepage, https://github.com/gesund-ai/gesund
Project-URL: Issues, https://github.com/gesund-ai/gesund/issues
Project-URL: Documentation, https://gesund-ai.github.io/
Keywords: gesund,medical,radiology,machine learning,ai,artificial intelligence
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: docutils
Requires-Dist: requests
Requires-Dist: bson
Requires-Dist: jsonschema
Requires-Dist: scikit-learn
Requires-Dist: pandas
Requires-Dist: seaborn
Requires-Dist: opencv-python
Requires-Dist: dictances==1.5.3
Requires-Dist: miseval==1.2.2
Requires-Dist: numpy==1.21.6
Requires-Dist: numba==0.55.2
Requires-Dist: tqdm
Requires-Dist: pydantic==2.9.2
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"

<h1 align="center">
  <img src="gesund/assets/gesund_logo.png" width="300" alt="Gesund Logo">
</h1><br>

# Validation Metrics Library

[![Test  Workflow](https://github.com/gesund-ai/gesund/actions/workflows/test.yml/badge.svg)](https://github.com/gesund-ai/gesund/actions/workflows/test.yml)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![PyPi](https://img.shields.io/pypi/v/gesund)](https://pypi.org/project/gesund)
[![PyPI Downloads](https://img.shields.io/pypi/dm/gesund.svg?label=PyPI%20downloads)](
https://pypi.org/project/gesund/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![python](https://img.shields.io/badge/Python-3.8-3776AB.svg?logo=python)](https://www.python.org)


This library provides tools for calculating validation metrics for predictions and annotations in machine learning workflows. It includes a command-line tool for computing and displaying validation metrics.

- **Documentation:**  https://gesund-ai.github.io
- **Source code:** https://github.com/gesund-ai/gesund
- **Bug reports:** https://github.com/gesund-ai/gesund/issues
- **Examples :** https://github.com/gesund-ai/gesund/tree/main/gesund/examples


## Installation

To use this library, ensure you have the necessary dependencies installed in your environment. You can install them via `pip`:

```sh
pip install gesund==latest_version
pip install pycocotools@git+https://github.com/HammadK44/cocoapi.git@Dev#subdirectory=PythonAPI/
```

## Basic Usage

```python
# import the library

from gesund import Validation
from gesund.validation._result import ValidationResult
from gesund.core._managers.metric_manager import metric_manager
from gesund.core._managers.plot_manager import plot_manager

# Call the default configuration from utils
from utils import callable_plot_config

# Select your problem type {"classification", "object_detection", "semantic_segmentation"}

# example usage for problem type
problem_type = "classification"
plot_configuration = callable_plot_config(problem_type)
metric_name = "lift_chart"
cohort_id = None
data_dir = f"./tests/_data/{problem_type}"

# create a class instance
validator = Validation(
    annotations_path=f"{data_dir}/gesund_custom_format/annotation.json",
    predictions_path=f"{data_dir}/gesund_custom_format/prediction.json",
    class_mapping=f"{data_dir}/test_class_mappings.json",
    problem_type=problem_type,
    data_format="json",
    json_structure_type="gesund",
    plot_config=plot_configuration,
    cohort_args={"selection_criteria": "random"},
    metric_args={"threshold": [0.25, 0.5, 0.75]},
)

# run the validation workflow
validation_results = validator.run()
# save the results 
validation_results.save(metric_name)
# plot the results
validation_results.plot(metric_name="auc", save_plot=False, cohort_id=cohort_id)

```


## Code of Conduct


We are committed to fostering a welcoming and inclusive community. Please adhere to the following guidelines when contributing to this project:

- **Respect**: Treat everyone with respect and consideration. Harassment or discrimination of any kind is not tolerated.
- **Collaboration**: Be open to collaboration and constructive criticism. Offer feedback gracefully and accept feedback in the same manner.
- **Inclusivity**: Use inclusive language and be mindful of different perspectives and experiences.
- **Professionalism**: Maintain a professional attitude in all project interactions.

By participating in this project, you agree to abide by this Code of Conduct. If you witness or experience any behavior that violates these guidelines, please contact the project maintainers.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

