Deep Learning议员投票记录预测其所属党派(伯努利贝叶斯分类模型)
代码实现如下
1 | import numpy as np |
1 | X=[["男","红"],["女","绿"],["女","蓝"],["男","绿"],["女","红"]] |
1 | X=[["男","蓝"],["女","红"],["女","红"],["男","蓝"],["女","蓝"]] |
1 | data=pd.read_csv("议案投票.csv") |
1 | #创建伯努利贝叶斯分类模型 |
1 | #对数据进行预测,通过混淆矩阵观察总体效果 |