Untitled
unknown
plain_text
2 years ago
705 B
16
Indexable
def acc(y_true, y_pred): true_counter = 0 for row_true in range(len(y_true)): for row_pred in range(len(y_pred)): if y_true.loc[row_true, 'Дата донации'] == y_pred.loc[row_pred, 'Дата донации']: true_temp_counter = 1 if y_true.loc[row_true, 'Класс крови'] == y_pred.loc[row_pred, 'Класс крови']: true_temp_counter += 1 if y_true.loc[row_true, 'Тип донации'] == y_pred.loc[row_pred, 'Тип донации']: true_temp_counter += 1 true_counter += true_temp_counter/3 return true_counter/len(y_true)
Editor is loading...