![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习
匪盗84
这个作者很懒,什么都没留下…
展开
-
机器学习实战笔记之knn
from numpy import *import operatordef createDataSet(): group = array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]]) labels = ['A','A','B','B'] return group,labelsdef classify0(inX, dataSet, labels, k):...翻译 2018-06-13 23:38:04 · 186 阅读 · 0 评论 -
svm
import numpy as np import matplotlib.pyplot as plt from sklearn import svm from sklearn.datasets import make_blobs X, y = make_blobs(n_samples = 50, centers = 2, random_state = 6) clf = svm.SVC(kerne...转载 2019-05-19 20:30:28 · 219 阅读 · 0 评论 -
sklearn 决策树
import pandas as pd import numpy as np import pylab as pl #from sklearn.cross_validation import train_test_split from sklearn.model_selection import train_test_split from sklearn.model_selection impo...转载 2019-02-25 00:51:31 · 174 阅读 · 0 评论 -
机器学习实战之逻辑回归
logRegres.py from numpy import * def loadDataSet(): dataMat = []; labelMat = [] fr = open('testSet.txt') for line in fr.readlines(): lineArr = line.strip().split() dataM...转载 2019-02-12 22:12:34 · 144 阅读 · 0 评论 -
机器学习实战笔记之朴素贝叶斯
bayes.py from numpy import * def loadDataSet(): postingList = [['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'], ['maybe', 'not', 'take', 'him', 'to', 'dog', 'park'...转载 2019-01-12 16:01:58 · 247 阅读 · 0 评论 -
机器学习实战笔记之决策树
一、trees.py from math import log import operator import treePlotter def calcShannonEnt(dataSet): numEntries = len(dataSet) labelCounts = {} for featVec in dataSet: currentLabel =...翻译 2018-07-26 22:48:21 · 149 阅读 · 0 评论