From ebb41a84d17d574366094e12c0a3a9477bb7ced3 Mon Sep 17 00:00:00 2001 From: Arunima Chaudhuri Date: Tue, 19 Mar 2024 23:11:15 +0000 Subject: [PATCH] Added heatmaps of netDegree vs failureRate on Missing Samples Signed-off-by: Arunima Chaudhuri --- DAS/visualizor.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/DAS/visualizor.py b/DAS/visualizor.py index cc66a2a..8ffb331 100644 --- a/DAS/visualizor.py +++ b/DAS/visualizor.py @@ -1111,7 +1111,28 @@ class Visualizor: } self.plotHeatMapData(conf) - + + # x -> network degree, y -> failure rate, weights -> no of missing samples + def plotNWDegVsFailureRateOnMissingSamples(self): + x = [result.shape.netDegree for result in self.results] + y = [result.shape.failureRate for result in self.results] + weights = [result.missingVector[-1] for result in self.results] + + if len(set(x)) * len(set(y)) < 2: return # Not enough unique params for heatmap + + conf = { + 'x': x, + 'y': y, + 'weights': weights, + 'xlabel': 'Net Degree', + 'ylabel': 'Failure Rate (%)', + 'title': 'Net Degree vs Failure Rate (%) on Missing Samples', + 'path': 'NWDegVsFailureRateOnMissingSamples.png' + } + + self.plotHeatMapData(conf) + def plotAllHeatMaps(self): self.plotNWDegVsNodeOnRuntime() - self.plotNWDegVsMalNodeOnMissingSamples() \ No newline at end of file + self.plotNWDegVsMalNodeOnMissingSamples() + self.plotNWDegVsFailureRateOnMissingSamples() \ No newline at end of file