|
|
|
|
|
|
吴裕雄 python深度学习与实践(8)
摘要:import cv2 import numpy as np img = cv2.imread("G:\\MyLearning\\TensorFlow_deep_learn\\data\\lena.jpg") img_hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV) turn_green_hsv = img_hsv.copy() turn_green_hsv[:...
阅读全文
吴裕雄 python深度学习与实践(7)
摘要:import cv2 import numpy as np img = np.mat(np.zeros((300,300))) cv2.imshow("test",img) cv2.waitKey(0) import cv2 import numpy as np img = np.mat(np.zeros((300,300),dtype=np.uint8)) cv2.imshow("te...
阅读全文
吴裕雄 python深度学习与实践(6)
摘要:from pylab import * import pandas as pd import matplotlib.pyplot as plot import numpy as np filePath = ("G:\\MyLearning\\TensorFlow_deep_learn\\data\\dataTest.csv") dataFile = pd.read_csv(filePath,h...
阅读全文
吴裕雄 python深度学习与实践(5)
摘要:import numpy as np data = np.mat([[1,200,105,3,False], [2,165,80,2,False], [3,184.5,120,2,False], [4,116,70.8,1,False], [5,270,150,4,True]...
阅读全文
吴裕雄 python深度学习与实践(4)
摘要:import numpy,math def softmax(inMatrix): m,n = numpy.shape(inMatrix) outMatrix = numpy.mat(numpy.zeros((m,n))) soft_sum = 0 for idx in range(0,n): outMatrix[0,idx] = math.exp...
阅读全文
吴裕雄 python深度学习与实践(3)
摘要:import threading, time def doWaiting(): print('start waiting:', time.strftime('%S')) time.sleep(3) print('stop waiting', time.strftime('%S')) thread1 = threading.Thread(target = doWaitin...
阅读全文
吴裕雄 python深度学习与实践(2)
摘要:#coding = utf8 import threading,time,random count = 0 class MyThread (threading.Thread): def __init__(self,lock,threadName): super(MyThread,self).__init__(name = threadName) sel...
阅读全文
吴裕雄 python深度学习与实践(1)
摘要:#coding = utf8 import threading,time count = 0 class MyThread(threading.Thread): def __init__(self,threadName): super(MyThread,self).__init__(name = threadName) def run(self): ...
阅读全文
吴裕雄 python 机器学习-Logistic(1)
摘要:import numpy as np def loadDataSet(): dataMat = [] labelMat = [] fr = open('D:\\LearningResource\\machinelearninginaction\\Ch05\\testSet.txt') for line in fr.readlines(): lin...
阅读全文
吴裕雄 python 熵权法确定特征权重
摘要:一、熵权法介绍 熵最先由申农引入信息论,目前已经在工程技术、社会经济等领域得到了非常广泛的应用。 熵权法的基本思路是根据各个特征和它对应的值的变异性的大小来确定客观权重。 一般来说,若某个特征的信息熵越小,表明该特征的值得变异(对整体的影响)程度越大,提供的信息量越多,在综合评价中所能起到 的作用也
阅读全文
吴裕雄 python 机器学习-NBYS(2)
摘要:import matplotlib import numpy as np import matplotlib.pyplot as plt n = 1000 xcord0 = [] ycord0 = [] xcord1 = [] ycord1 = [] markers =[] colors =[] for i in range(n): [r0,r1] = np.random.stan...
阅读全文
吴裕雄 python 机器学习-NBYS(1)
摘要:import numpy as np def loadDataSet(): postingList=[['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'], ['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'], ...
阅读全文
吴裕雄 python 爬虫(4)
摘要:............................................ 50 .................................................................. ...................................
阅读全文
吴裕雄 python 爬虫(3)
摘要:........................................................
阅读全文
吴裕雄 python 爬虫(2)
摘要:import requests from bs4 import BeautifulSoup url = 'http://www.baidu.com' html = requests.get(url) sp = BeautifulSoup(html.text, 'html.parser') print(sp) html_doc = """ 页标题 文件标题 Once upon a t...
阅读全文
吴裕雄 python 爬虫(1)
摘要:from urllib.parse import urlparse url = 'http://www.pm25x.com/city/beijing.htm' o = urlparse(url) print(o) print("scheme={}".format(o.scheme)) # http print("netloc={}".format(o.netloc)) # www.pm25...
阅读全文
吴裕雄 python 机器学习-DMT(2)
摘要:import matplotlib.pyplot as plt decisionNode = dict(boxstyle="sawtooth", fc="0.8") leafNode = dict(boxstyle="round4", fc="0.8") arrow_args = dict(arrowstyle=" maxDepth: maxDepth = thisDepth retu...
阅读全文
吴裕雄 python 机器学习-KNN(2)
摘要:...................................................
阅读全文
吴裕雄 python 机器学习-KNN算法(1)
摘要:................................................ .......................................
阅读全文
|
|