Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix plot and Track Origin confusion matrix #258

Merged
merged 17 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed save path of the track origin plot, and some minor changes to c…
…omments
  • Loading branch information
LucioDerin committed Mar 10, 2024
commit f5a9c82493231971e43ecd89903b3f29019b9547
4 changes: 2 additions & 2 deletions puma/hlplots/aux_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def plot_track_origin_confmat(
to allow better readability on darker cmap colors. If 1, all text is black;
if 0, all text is white. by default 0.6
colormap : plt.cm, optional
Colormap of the plot, by default plt.cm.Oranges
Colormap of the plot, by default `plt.cm.Oranges`
atlas_offset : float, optional
Space at the top of the plot reserved to the Atlasify text. by default 1.5
"""
Expand Down Expand Up @@ -455,4 +455,4 @@ def plot_track_origin_confmat(
atlas_second_tag=self.atlas_second_tag,
)

plot_cm.savefig(tagger.name + "_trackorigin_cm.png")
plot_cm.savefig(self.get_filename(tagger.name + "_trackorigin_cm.png"))
6 changes: 3 additions & 3 deletions puma/matshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def __init__(
show_entries : bool, optional
If True, show matrix entries as numbers in the plot. by default True
show_percentage : bool, optional
If True, if matrix entries are percentages (numbers in [0,1]), show them as such.
by default False
If True, if matrix entries are percentages (numbers in [0,1]), format them as
percentages. by default False
text_color_threshold : float, optional
percentage of the range of matrix's values after which the text color switches to white,
to allow better readability on darker cmap colors. If 1, all text is black;
if 0, all text is white. by default 0.6
colormap : plt.cm, optional
Colormap for the plot, by default plt.cm.Oranges
Colormap for the plot, by default `plt.cm.Oranges`
cbar_label : str | None, optional
Label of the colorbar, by default None
atlas_offset : float, optional
Expand Down
2 changes: 1 addition & 1 deletion puma/utils/confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def confusion_matrix(
-------
np.ndarray : the confusion matrix.

Example:
Example
--------
>>> targets = np.array([2, 0, 2, 2, 0, 1])
>>> predictions = np.array([0, 0, 2, 2, 0, 2])
Expand Down