【发布时间】:2021-10-13 19:24:04
【问题描述】:
我有多个熊猫数据框如下:
data1 = {'1':[4], '2':[2], '3':[6]}
original= pd.DataFrame(data1)
data2 = {'1':[3], '2':[5], '5':[5]}
predect1 = pd.DataFrame(data2)
data3 = {'1':[2], '3':[4], '5':[5], '6':[2]}
predect2 = pd.DataFrame(data3)
data4 = {'1':[4], '2':[2], '3':[6]}
predect3= pd.DataFrame(data4)
与原始数据帧相比,我如何(分别)计算 predect1、predect2 和 predect3 的精度、准确度和召回率。
注意:与原始数据框相比,它可能有一些额外的列。所以,我需要考虑可用列的数量并处理额外的列。 有没有办法找到准确度并计算 Precison & Recall
列名:
Index(['1', '2', '3'], dtype='object')
Index(['1', '2', '5'], dtype='object')
Index(['1', '3', '5', '6'], dtype='object')
Index(['1', '2', '3'], dtype='object')
【问题讨论】:
-
能否列出 predict 和 actual 的列名,或者字典中提到的列名
-
Index(['1', '2', '3'], dtype='object') Index(['1', '2', '5'], dtype='object') Index(['1', '3', '5', '6'], dtype='object') Index(['1', '2', '3'], dtype='object')
标签: python pandas machine-learning scikit-learn metrics