Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Jul 20, 2024
1 parent d0d111b commit 76cac17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .devel/sphinx/alphamarek.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_book_template(self, e):
self.format_btitle(e, 'title'),
self.format_volume_and_series(e),
sentence [
field('publisher'),
optional_field('publisher'),
optional_field('address'),
self.format_edition(e)
],
Expand Down
4 changes: 2 additions & 2 deletions .devel/sphinx/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ @book{datawranglingpy
publisher = {Zenodo},
address = {Melbourne},
url = {https://datawranglingpy.gagolewski.com/},
year = {2022}
year = {2024}
}

@book{deepr,
author = {M. Gagolewski},
title = {Deep {R} Programming},
url = {https://deepr.gagolewski.com/},
year = {2023},
year = {2024},
doi = {10.5281/zenodo.7490464},
isbn = {978-0-6455719-2-9},
publisher = {Zenodo},
Expand Down
10 changes: 6 additions & 4 deletions clustbench/load_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ def save_results(filename, results, expanduser=True, expandvars=True):
>>> results_path = os.path.join("~", "Projects", "clustering-results-v1", "original")
>>> res = clustbench.load_results("*", "wut", "x2", 3, path=results_path)
>>> print(res.keys())
>>> clustbench.save_results("x1.result3.gz", clustbench.transpose_results(res)[3])
>>> clustbench.save_results(
... os.path.join(results_path, "method", "wut", "x2.result3.gz"),
... clustbench.transpose_results(res)[3])
"""
if type(results) is not dict:
raise ValueError("`results` is not a dict")
Expand All @@ -223,11 +225,11 @@ def save_results(filename, results, expanduser=True, expandvars=True):
if not np.all(res.min().isin([0, 1])):
raise ValueError("Minimal label neither 0 nor 1.")

mx = res.max()
if not mx[0] >= 1:
mx = res.max(axis=None)
if not mx >= 1:
raise ValueError("At least 1 cluster is necessary.")

if not np.all(mx == mx[0]):
if not np.all(res.max(axis=0) == mx):
raise ValueError("All partitions should be of the same cardinality.")

if not np.all(res.apply(np.bincount).iloc[1:, :] > 0):
Expand Down

0 comments on commit 76cac17

Please sign in to comment.