мой код:
Код: Выделить всё
import os
import random
from tqdm import tqdm
import pandas as pd
import numpy as np
import torch.nn as nn
import json
import seaborn as sns
import matplotlib.pyplot as plt
i = 16
# To read the json file
a_file = open(str(i)+"_results.json", "r")
a_dictionary = json.load(a_file)
mp = a_dictionary
print((a_dictionary.keys()))
x = [print(i) for i in range(1,7)]
sns.lineplot(x=x, y=mp['16']['fed_acc'], marker='o',color='navy', label='acc')
Код: Выделить всё
{"16": {"fed_acc": [0.9981039991573329, 0.9981039991573329, 0.9981039991573329, 0.998139110284049, 0.998139110284049, 0.9983497770443454],
"fed_pre": [0.0, 0.0, 0.0, 1.0, 1.0, 1.0],
"fed_recall": [0.0, 0.0, 0.0, 0.018518518518518517, 0.018518518518518517, 0.12962962962962962],
"fed_f1": [0.0, 0.0, 0.0, 0.03636363636363636, 0.03636363636363636, 0.22950819672131148]}}
Подробнее здесь: https://stackoverflow.com/questions/787 ... line-plots