Skip to main content

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

Project description

Gesund Logo


Validation Metrics Library

PyPi PyPI Downloads

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.

Installation

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

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

Basic Usage

# import the library
from gesund.validation import Validation

# set up the configs
data_dir = "./tests/_data/classification"
plot_config = {
    "classification": {
        "class_distributions": {
            "metrics": ["normal", "pneumonia"],
            "threshold": 10,
        },
        "blind_spot": {"class_type": ["Average", "1", "0"]},
        "performance_by_threshold": {
            "graph_type": "graph_1",
            "metrics": [
                "F1",
                "Sensitivity",
                "Specificity",
                "Precision",
                "FPR",
                "FNR",
            ],
            "threshold": 0.2,
        },
        "roc": {"roc_class": ["normal", "pneumonia"]},
        "precision_recall": {"pr_class": ["normal", "pneumonia"]},
        "confidence_histogram": {"metrics": ["TP", "FP"], "threshold": 0.5},
        "overall_metrics": {"metrics": ["AUC", "Precision"], "threshold": 0.2},
        "confusion_matrix": {},
        "prediction_dataset_distribution": {},
        "most_confused_bar": {},
        "confidence_histogram_scatter_distribution": {},
        "lift_chart": {},
    }
}

# create a class instance
classification_validation = Validation(
    annotations_path=f"{data_dir}/gesund_custom_format/annotation.json",
    predictions_path=f"{data_dir}/gesund_custom_format/prediction.json",
    problem_type="classification",
    class_mapping=f"{data_dir}/test_class_mappings.json",
    data_format="json",
    json_structure_type="gesund",
    metadata_path=f"{data_dir}/test_metadata.json",
    return_dict=True,
    display_plots=False,
    store_plots=False,
    plot_config=plot_config,
    run_validation_only=True
)

# run the validation workflow
results = classification_validation.run()

# explore the results
print(results)

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 file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gesund-0.1.5.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gesund-0.1.5-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file gesund-0.1.5.tar.gz.

File metadata

  • Download URL: gesund-0.1.5.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for gesund-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f4f0b4405ee585e1450346cc54c468ed7209f7652e6f88f7b0fe790a8f01f586
MD5 ed931ba1dfdcb3d20887d9729bc39f58
BLAKE2b-256 7b356571c4406ef215d77390cef9e5c4d5527429a4f7a477255e0d456b3e5fbe

See more details on using hashes here.

File details

Details for the file gesund-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: gesund-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for gesund-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a6178b1a700a3b9e05c9f4c4997b54e625593465800ccce9cc6e7c0149b26672
MD5 f0affae19defd04acf17207be69f5a5c
BLAKE2b-256 a5296508364d97fdf6d46c0889f0b90f2d6f9b9a3a8f793aaa7acc0fc12e7607

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page