Skip to content

Commit

Permalink
update README and add requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonfan1997 committed Oct 18, 2024
1 parent 0ba8d5a commit ff0f0e2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
3 changes: 0 additions & 3 deletions GUI_cal_metrics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import argparse
import numpy as np
import subprocess
import time
import matplotlib.pyplot as plt
from nicegui import ui, app


Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions cal_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions citation.cff
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy == 1.26.4
scipy == 1.14.1
matplotlib == 3.8.0
statsmodels == 0.14.2

0 comments on commit ff0f0e2

Please sign in to comment.