mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-04 06:03:10 +00:00
Restore column count boxen plot updated
This commit is contained in:
parent
bfd75feaa9
commit
8aaaf57ed6
@ -316,10 +316,22 @@ class Visualizor:
|
|||||||
conf["title"] = "Boxen Plot of Restore Column Count by Nodes"
|
conf["title"] = "Boxen Plot of Restore Column Count by Nodes"
|
||||||
conf["xlabel"] = "Restore Column Count"
|
conf["xlabel"] = "Restore Column Count"
|
||||||
conf["ylabel"] = "Nodes"
|
conf["ylabel"] = "Nodes"
|
||||||
n1 = int(result.numberNodes * result.class1ratio)
|
data = []
|
||||||
data = [result.restoreColumnCount[1: n1], result.restoreColumnCount[n1+1: ]]
|
nodeClasses, nodeRanges = self.__getNodeRanges(result.shape)
|
||||||
|
_start = 1
|
||||||
|
for _range in nodeRanges:
|
||||||
|
data.append(result.restoreColumnCount[_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))
|
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.xlabel(conf["xlabel"], fontsize=12)
|
||||||
plt.ylabel(conf["ylabel"], fontsize=12)
|
plt.ylabel(conf["ylabel"], fontsize=12)
|
||||||
plt.title(conf["title"], fontsize=14)
|
plt.title(conf["title"], fontsize=14)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user