朴素贝叶斯算法实例
发布时间
阅读量:
阅读量
"""
朴素贝叶斯算法案例
"""
import numpy as np
#准备数据
def loadDataSets():
"""
加载数据集
:return: dataMatrix,labelList
"""
dataMatrix = [
["stop", "fuck", "you", "bitch", "garbage"],
["useless", "dog", "stupid", "worthless"],
["suck", "my", "dick", "bitch", "pig", "asshole"],
["son", "bitch", "hoocker", "happy"],
['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'],
['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'him'],
['mr', 'licks', 'ate', 'my', 'steak', 'how', 'to', 'stop', 'him'],
]
全部评论 (0)
还没有任何评论哟~
