摘要: 1 import matplotlib.pyplot as plt 2 3 fig = plt.figure() 4 x = [1, 2, 3, 4, 5, 6, 7] 5 y = [1, 3, 4, 2, 5, 8, 6] 6 7 # below are all percentage 8 left, bottom, width, height = 0.1, 0.1, 0.8... 阅读全文
posted @ 2019-07-26 09:23 小伙郭 阅读(705) 评论(0) 推荐(0) 编辑
摘要: 1 import matplotlib.pyplot as plt 2 3 # example 1: 4 ############################### 5 plt.figure(figsize=(6, 4)) 6 # plt.subplot(n_rows, n_cols, plot_num) 7 plt.subplot(2, 2, 1) 8 plt.plot(... 阅读全文
posted @ 2019-07-26 09:20 小伙郭 阅读(1383) 评论(0) 推荐(0) 编辑
摘要: 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 #定义计算高度的函数 5 def f(x,y): 6 return (1 - x/2 + x**5 +y**3) * np.exp(-x**2 - y**2) 7 8 n = 256 9 x = np.linspace(-3, 3, n) 10 y ... 阅读全文
posted @ 2019-07-26 09:17 小伙郭 阅读(2812) 评论(0) 推荐(0) 编辑
摘要: 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 x = np.linspace(-3, 3, 50) 5 y1 = 2 * x + 1 6 7 #figure 1 8 plt.figure() 9 plt.plot(x, y1, linewidth = 10,zorder=1) 10 11 12 #横... 阅读全文
posted @ 2019-07-26 09:12 小伙郭 阅读(1431) 评论(0) 推荐(0) 编辑
摘要: 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 x = np.linspace(-3, 3, 50) 5 y1 = 2 * x + 1 6 y2 = x ** 2 7 8 plt.figure() 9 l1, = plt.plot(x, y1, color = "red", linewidth = 5.0... 阅读全文
posted @ 2019-07-25 21:25 小伙郭 阅读(1249) 评论(0) 推荐(0) 编辑
摘要: #坐标轴的移动 阅读全文
posted @ 2019-07-25 21:19 小伙郭 阅读(640) 评论(0) 推荐(0) 编辑
摘要: 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 x = np.linspace(-3, 3, 50) 5 y1 = 2 * x + 1 6 y2 = x ** 2 7 8 #figure 1 9 plt.figure() 10 plt.plot(x, y1) 11 12 #figure 2 13 plt... 阅读全文
posted @ 2019-07-25 21:18 小伙郭 阅读(787) 评论(0) 推荐(0) 编辑
摘要: 一、算法详解 1.什么是K临近算法 Cover 和 Hart在1968年提出了最初的临近算法 属于分类(classification)算法 邻近算法,或者说K最近邻(kNN,k-NearestNeighbor)分类算法是数据挖掘分类技术中最简单的方法之一。 所谓K最近邻,就是k个最近的邻居的意思,说 阅读全文
posted @ 2019-03-20 10:37 小伙郭 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 一、机器学习基本概念总结 分类(classification):目标标记为类别型的数据(离散型数据)回归(regression):目标标记为连续型数据 有监督学习(supervised learning):训练集有类别标记无监督学习(unsupervised learning):训练集无类别标记半监 阅读全文
posted @ 2019-03-17 19:10 小伙郭 阅读(673) 评论(2) 推荐(0) 编辑
摘要: re模块(正则表达式) 就其本质而言,正则表达式是一种小型的、高度专业化的编程语言 在Python中(它内嵌在python中),并通过re模块来实现,正则表达式被编译成一系列的字节码,然后由C编写的匹配引擎执行 正则:模糊匹配(针对字符串的一些操作),匹配的是这些元素的共性 字符匹配(普通字符,元字 阅读全文
posted @ 2019-03-14 11:44 小伙郭 阅读(292) 评论(0) 推荐(0) 编辑