- 博客(13)
- 收藏
- 关注
原创 FP树
__author__ = 'IanHwang'# coding:utf-8def createTree(dataSet, minSup=1): #create FP-tree from dataset but don't mine headerTable = {} #go over dataSet twice for trans in dataSet:#first pa
2015-03-17 11:28:51
1038
转载 KNN
# coding:utf-8import sklearn.datasetsimport sklearn.neighborsimport numpy.randomimport matplotlib.pyplotimport matplotlib.colorsif __name__ == "__main__": # Load iris dataset iris = skl
2015-03-09 17:26:54
375
转载 LogisticRegression逻辑回归
# coding:utf-8import sklearn.datasetsimport sklearn.linear_modelimport numpy.randomimport matplotlib.pyplotif __name__ == "__main__": # Load iris dataset iris = sklearn.datasets.load_iri
2015-03-09 17:11:45
696
转载 Elastic Net
# coding:utf-8import sklearn.datasetsimport sklearn.linear_modelimport numpy.randomimport numpy.linalgimport matplotlib.pyplotif __name__ == "__main__": # Load boston dataset boston = s
2015-03-09 16:57:24
898
转载 Lasso
# coding:utf-8import sklearn.datasetsimport sklearn.linear_modelimport numpy.randomimport numpy.linalgimport matplotlib.pyplotif __name__ == "__main__": # Load boston dataset boston = s
2015-03-09 16:12:43
676
转载 Ridge Regression 岭回归
# coding:utf-8import sklearn.datasetsimport sklearn.linear_modelimport numpy.randomimport numpy.linalgimport matplotlib.pyplotif __name__ == "__main__": # Load boston dataset boston = s
2015-03-09 16:05:30
684
转载 Ordinary Least Squares 最小二乘约束
# coding:utf-8import sklearn.datasetsimport sklearn.linear_modelimport numpy.randomimport numpy.linalgimport matplotlib.pyplotif __name__ == "__main__": # Load boston dataset boston =
2015-03-09 15:46:33
810
原创 朴素贝叶斯算法
# coding=utf-8from math import logfrom numpy import *def loadDataSet(): postingList=[['my','dog','has','flea','problems','help','please'], ['maybe','not','take','him','to','dog
2015-03-02 18:10:10
444
转载 AdaBoost算法
# coding=utf-8from math import log, expfrom numpy.core.umath import signfrom numpy.ma import multiplyfrom numpy import *def loadSimpleDate(): dataMat = matrix([[1. , 2.1],
2015-03-02 17:53:41
409
原创 Python MILK多核处理
__author__ = 'IanHwang'import timeimport numpy as npimport milkfrom milk.ext.jugparallel import nfoldcrossvalidationfrom milk.utils import parallelstart_time = time.time()parallel.set_max_proce
2015-02-12 17:28:23
551
转载 Parallel Python多核并行
__author__ = 'IanHwang'# Desc: This program demonstrates parallel computations with pp module # It calculates the sum of prime numbers below a given integer in parallel # Parallel Python Software
2015-02-11 10:22:33
523
转载 Python感知机算法
# _*_ coding:utf-8 _*_import copyfrom matplotlib import pyplot as pltfrom matplotlib import animationtraining_set = [[(3,3),1],[(4,3),1],[(1,1),-1]]w = [0, 0]b = 0history = []def update(item
2015-02-07 16:36:45
578
原创 Python内排序
__author__ = 'IanHwang'# __coding:utf8__# 冒泡排序# 时间复杂度:O(n ^ 2)# 稳定排序def BubbleSort(array): for i in range(0, len(array)): flag = True for j in range(i, 0, -1): if
2015-02-07 15:45:50
422
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人