import os
import sys

import matplotlib.pyplot as plt
from io import StringIO

sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from _metricmap import draw  # noqa: E402

# Six metrics, each a fraction of the confusion matrix of the 20 patients at threshold 0.5.
fig = draw(['accuracy', 'precision', 'recall', 'specificity', 'false positive', 'negative'], 2, 3, figsize=(10, 7.6))

buffer = StringIO()
plt.savefig(buffer, format="svg", transparent=True)
print(buffer.getvalue())

plt.close()
