作者:hhh5460 大抵分成两类 一.离散的.标签化的数据 原文没有使用pandas,我使用pandas重新实现了朴素贝叶斯算法,看起来非常简洁.清爽. import pandas as pd ''' 导入数据集 {a1 = 0, a2 = 0, C = 0} {a1 = 0, a2 = 0, C = 1} {a1 = 0, a2 = 0, C = 0} {a1 = 0, a2 = 0, C = 1} {a1 = 0, a2 = 0, C = 0} {a1 = 0, a2 = 0, C = 1