
机器学习实战
小盼你最萌哒
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
k-近邻算法
from numpy import * import operator import matplotlib import matplotlib.pyplot as plt from os import listdir #用于列出文件列表 from time import time #用于运行时间计算 def createDataSet(): group = array([[1.0,1....原创 2018-10-07 09:54:02 · 134 阅读 · 0 评论 -
决策树
from math import log import operator def createDataSet(): dataSet = [[1, 1, 'maybe'], [1, 1, 'yes'], [1, 0, 'no'], [0, 1, 'no'], [0, 1...原创 2018-10-07 10:00:25 · 171 阅读 · 0 评论 -
朴素贝叶斯
from numpy import * #创建数据集 #包含组成6个句子的单词 #和每个句子总体含义是否具有侮辱性的标签向量 def loadDataSet(): postingList=[['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'], ['maybe', 'not', 'take'...原创 2018-10-07 10:06:13 · 151 阅读 · 0 评论 -
使用朴素贝叶斯过滤垃圾邮件
split文本分割函数 mySent='This book is the best book on Python or M.L. I have ever laid eyes upon.' ret=mySent.split() print(ret) 输出 ['This', 'book', 'is', 'the', 'best', 'book', 'on', 'Python', 'or', 'M.L...原创 2018-10-07 14:53:09 · 952 阅读 · 1 评论 -
logistic回归
# coding=gbk from numpy import * def loadDataSet(): dataMat = []; labelMat = [] fr = open('testSet.txt') for line in fr.readlines(): lineArr = line.strip().split() #某个点所对应...原创 2019-05-30 08:48:01 · 153 阅读 · 0 评论