mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-10 09:03:12 +00:00
Samples Received boxen plot updated
This commit is contained in:
parent
346195bd8d
commit
86e9a78f34
@ -567,10 +567,22 @@ class Visualizor:
|
||||
conf["title"] = "Number of Samples Received by Nodes"
|
||||
conf["xlabel"] = "Node Type"
|
||||
conf["ylabel"] = "Number of Samples Received"
|
||||
n1 = int(result.numberNodes * result.class1ratio)
|
||||
data = [result.sampleRecvCount[1: n1], result.sampleRecvCount[n1+1: ]]
|
||||
data = []
|
||||
nodeClasses, nodeRanges = self.__getNodeRanges(result.shape)
|
||||
_start = 1
|
||||
for _range in nodeRanges:
|
||||
data.append(result.sampleRecvCount[_start: _range])
|
||||
_start = _range
|
||||
_values, _categories = [], []
|
||||
for _d, _nc in zip(data, nodeClasses):
|
||||
_values += _d
|
||||
_categories += [f'Class {_nc}'] * len(_d)
|
||||
data = pd.DataFrame({
|
||||
'values': _values,
|
||||
'category': _categories
|
||||
})
|
||||
plt.figure(figsize=(8, 6))
|
||||
sns.boxenplot(data=data, width=0.8)
|
||||
sns.boxenplot(x='category', y='values', data=data, palette="Set2", ax=plt.gca(), width=0.8)
|
||||
plt.xlabel(conf["xlabel"], fontsize=12)
|
||||
plt.ylabel(conf["ylabel"], fontsize=12)
|
||||
plt.title(conf["title"], fontsize=14)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user