работает
Код: Выделить всё
from matplotlib import pyplot as plt
f, ax = plt.subplots()
print(type(ax))
Код: Выделить всё
Код: Выделить всё
from matplotlib import axes
print(type(axes._subplots))
print(type(axes._subplots.AxesSubplot))
Код: Выделить всё
AttributeError: module 'matplotlib.axes._subplots' has no attribute 'AxesSubplots'
Код: Выделить всё
def multi_rocker(
axy: type(plt.subplots()[1]),
y_trues: np.ndarray,
y_preds: np.ndarray,
):
"""
One-Vs-All ROC-curve:
"""
fpr = dict()
tpr = dict()
roc_auc = dict()
n_classes = y_trues.shape[1]
wanted = list(range(n_classes))
for i,x in enumerate(wanted):
fpr[i], tpr[i], _ = roc_curve(y_trues[:, i], y_preds[:, i])
roc_auc[i] = round(auc(fpr[i], tpr[i]),2)
extra = 0
for i in range(n_classes):
axy.plot(fpr[i], tpr[i],)
return
Подробнее здесь: https://stackoverflow.com/questions/637 ... in-python3