analyzerPrecision property

Map<String, double> get analyzerPrecision

Implementation

Map<String, double> get analyzerPrecision {
  final map = <String, List<double>>{};
  for (final entry in entries) {
    for (final tp in entry.truePositives) {
      map.putIfAbsent(tp.analyzerName, () => []).add(1.0);
    }
    for (final fp in entry.falsePositives) {
      final an = _analyzerNameFromCode(fp.code);
      map.putIfAbsent(an, () => []).add(0.0);
    }
  }
  return map.map((k, v) => MapEntry(k, v.reduce((a, b) => a + b) / v.length));
}