Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion dnotebooks/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def draw(self):
seeds_confusion_matrices,
self.epoch[0], self.epoch[1]
)[:len(Y)]
self._ax.fill_between(X, Y_lower_bound, Y_upper_bound, color=c, alpha=.3)
self._ax.fill_between(X, Y_lower_bound, Y_upper_bound, color=c, alpha=.1)
self._ax.plot(X, Y, color=c, label=label, alpha=1, **linestyle)

if self.ylimit:
Expand Down
21 changes: 19 additions & 2 deletions dnotebooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,24 @@ def get(self, key: str) -> str:
@dataclass
class LineStyle:
DEFAULT = 'solid'
MARKERS = ['*', 'o', 's', 'D']
LINESTYLES = ['solid', 'dashed', 'dotted']
STYLE_OPTIONS = [
'solid',
'dashed',
'dotted',
'*',
'o',
's',
'D'
'D',
'dashed-o',
'dashed-s',
'dashed-D',
'dashed-*',
'dotted-o',
'dotted-s',
'dotted-D',
'dotted-*',
]

linestyle: Optional[str] = None
Expand All @@ -77,6 +87,13 @@ def to_kwargs(self):

@staticmethod
def resolve(label: Optional[str]) -> LineStyle:
if label in ['*', 'o', 's', 'D']:
if label is None:
return LineStyle(None, None)
if label in LineStyle.MARKERS:
return LineStyle('solid', label)
if '-' in label:
linestyle, marker = label.split('-', 1)
if linestyle in LineStyle.LINESTYLES and marker in LineStyle.MARKERS:
return LineStyle(linestyle, marker)
raise ValueError(f"Unknown line style: {label!r}")
return LineStyle(label, None)
7 changes: 4 additions & 3 deletions dnotebooks/widgets/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def aggregate_mean(self) -> ExperimentMetric:
if len(self.metrics) == 1:
return ExperimentConfusionMatrix(
devices_confusion_matrices=m0.data,
description=m0.description
description=m0.description,
time_devices_confusion_matrices=m0.time_data
)

metrics_mean = [m.mean() for m in self.metrics]
Expand Down Expand Up @@ -330,7 +331,7 @@ def ConfusionMatrixPartitionMultiSelection(
experiments_groups: List[ExperimentGroup],
description: str = "Select confusion matrix:"
):
def get_selection() -> Optional[Dict[str, ExperimentConfusionMatrix]]:
def get_confusion_matrix() -> Optional[Dict[str, ExperimentConfusionMatrix]]:
if confusion_matrix_selection.value is None:
return
matrices = {}
Expand Down Expand Up @@ -358,4 +359,4 @@ def get_selection() -> Optional[Dict[str, ExperimentConfusionMatrix]]:
confusion_matrix_selection
], layout=layout)

return widget, get_selection
return widget, get_confusion_matrix
Loading