Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Oct 8, 2020
1 parent 53f383d commit 1f56a5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 2 additions & 4 deletions src/superintendent/acquisition_functions/functions.py
Expand Up @@ -58,11 +58,10 @@ def margin(probabilities: np.ndarray) -> np.ndarray:
new labels and catching any minority classes the algorithm currently
classifies as a different label.
"""
margin = (
return (
np.sort(probabilities, axis=1)[:, -1]
- np.sort(probabilities, axis=1)[:, -2]
)
return margin


@make_acquisition_function(handle_multioutput="mean") # noqa: D002
Expand All @@ -86,8 +85,7 @@ def certainty(probabilities: np.ndarray):
classifies as a different label.
"""
certainty = probabilities.max(axis=-1)
return certainty
return probabilities.max(axis=-1)


@make_acquisition_function(handle_multioutput="mean")
Expand Down
16 changes: 7 additions & 9 deletions src/superintendent/base.py
Expand Up @@ -189,9 +189,7 @@ def _annotation_iterator(self):
self._display(x)
y = yield

if y is None:
pass
else:
if y is not None:
self.queue.submit(id_, y)

self.progressbar.value = self.queue.progress
Expand Down Expand Up @@ -285,13 +283,13 @@ def _compose(self):
]

def _render_processing(self, message="Rendering..."):
message = (
"<h1>{}".format(message)
+ '<i class="fa fa-spinner fa-spin"'
+ ' aria-hidden="true"></i>'
)
processing_display = widgets.HTML(value=message)
with self.feature_output:
message = (
"<h1>{}".format(message)
+ '<i class="fa fa-spinner fa-spin"'
+ ' aria-hidden="true"></i>'
)
processing_display = widgets.HTML(value=message)
IPython.display.clear_output()
display.default_display_function(processing_display)

Expand Down

0 comments on commit 1f56a5e

Please sign in to comment.