def _process_metric(self, ax, metric):
if not metric.data.size:
ax.tick_params(colors=(0, 0, 0, 0))
ax.set_axis_bgcolor(cm.get_cmap('viridis')(0))
divider = make_axes_locatable(ax)
divider.append_axes('right', size='7%', pad=0.1).axis('off')
return
domain = self._domain(metric)
categorical = self._is_categorical(metric.data)
if metric.data.shape[1] == 1 and not categorical:
self._plot_scalar(ax, domain, metric.data[:, 0])
elif metric.data.shape[1] == 1:
indices = metric.data[:, 0].astype(int)
min_, max_ = indices.min(), indices.max()
count = np.eye(max_ - min_ + 1)[indices - min_]
self._plot_distribution(ax, domain, count)
elif metric.data.shape[1] > 1:
self._plot_counts(ax, domain, metric.data)
评论列表
文章目录