-
Notifications
You must be signed in to change notification settings - Fork 18
Add experiment class (Sourcery refactored) #62
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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) | ||
|
Comment on lines
-89
to
+88
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
|
||
|
|
||
| @make_acquisition_function(handle_multioutput="mean") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,9 +189,7 @@ def _annotation_iterator(self): | |
| self._display(x) | ||
| y = yield | ||
|
|
||
| if y is None: | ||
| pass | ||
| else: | ||
| if y is not None: | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| self.queue.submit(id_, y) | ||
|
|
||
| self.progressbar.value = self.queue.progress | ||
|
|
@@ -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) | ||
|
Comment on lines
-288
to
+292
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
| IPython.display.clear_output() | ||
| display.default_display_function(processing_display) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
marginrefactored with the following changes:inline-immediately-returned-variable)