From ff0f0e2799295ad2559c9d3782c57778dc2e7c24 Mon Sep 17 00:00:00 2001 From: jasonfan1997 Date: Fri, 18 Oct 2024 11:17:36 -0400 Subject: [PATCH] update README and add requirements.txt --- GUI_cal_metrics.py | 3 --- README.md | 21 ++++++++++++++++++--- cal_metrics.py | 2 ++ citation.cff | 11 +++++++++++ requirements.txt | 4 ++++ 5 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 citation.cff create mode 100644 requirements.txt diff --git a/GUI_cal_metrics.py b/GUI_cal_metrics.py index 28cf70a..f6dd1c2 100644 --- a/GUI_cal_metrics.py +++ b/GUI_cal_metrics.py @@ -1,8 +1,5 @@ import argparse -import numpy as np import subprocess -import time -import matplotlib.pyplot as plt from nicegui import ui, app diff --git a/README.md b/README.md index d5ea8f2..2030979 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,28 @@ calzone is a comprehensive Python package for calculating and visualizing variou ## Installation -You can install calzone using pip: -pip install -e "git+https://github.com/DIDSR/calzone.git" +`calzone` package require installation of `numpy`, `scipy`, `matplotlib` and `statsmodels`. If you need to run GUI, `nicegui` is also required. +You can install calzone using pip: +``` +pip install -e "git+https://github.com/DIDSR/calzone.git"#egg=calzone` +``` + +Alternatively, you can clone the repository and install it locally: +``` +git clone https://github.com/DIDSR/calzone.git +cd calzone +pip install . +``` ## Usage -run `python cal_metrics.py -h` to see the help information and usage. To use the package in your Python code, please refer to the examples in the documentation pages. +run `python cal_metrics.py -h` to see the help information and usage. To use the package in your Python code, please refer to the examples in the documentation pages. + +To use GUI, run `python GUI_cal_metrics.py` (GUI is under development, use with caution.) ## Documentation For detailed documentation and API reference, please visit our [documentation pdf](https://github.com/DIDSR/calzone/blob/main/docs/build/latex/calzone.pdf). + + +## Disclaimer diff --git a/cal_metrics.py b/cal_metrics.py index ad6ce33..39995a4 100755 --- a/cal_metrics.py +++ b/cal_metrics.py @@ -55,10 +55,12 @@ def perform_calculation(probs, labels, args, suffix=""): # Save metrics to CSV if args.save_metrics: + print("Saving result to", args.save_metrics) save_metrics_to_csv(result, keys, args.save_metrics, suffix) # Plot reliability diagram if args.plot: + print("Saving plot to", args.save_plot) plot_reliability(labels, probs, args, suffix) return result diff --git a/citation.cff b/citation.cff new file mode 100644 index 0000000..8ec7c5d --- /dev/null +++ b/citation.cff @@ -0,0 +1,11 @@ +cff-version: 1.2.0 +message: "If you use this software, please cite it as below." +authors: +- family-names: "Fan" + given-names: "Kwok Lung" + orcid: "https://orcid.org/0000-0002-2180-9082" +- family-names: "Cao" + given-names: "Qian" +title: "calzone: A Python package for measring calibration of probablistic models for classification" +date-released: 2024-10-18 +url: "https://github.com/DIDSR/calzone" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a15297a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +numpy == 1.26.4 +scipy == 1.14.1 +matplotlib == 3.8.0 +statsmodels == 0.14.2 \ No newline at end of file