自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 资源 (5)
  • 收藏
  • 关注

转载 数据生成

参考此文章

2019-05-12 16:04:11 238

原创 SKLEARN--数据预处理

1.数据标准化(去均值和方差按比例缩放)标准化import numpy as npfrom sklearn import preprocessingdata = np.array([[ 1., 100., -7], [ 2., -50., 10], [ 0., 200, 200]]) #标准化去...

2019-05-12 10:52:50 313

原创 SKLEARN--特征提取(不完整)

1.从字典类型加载特征类 DictVectorizer 可用于将标准的Python字典(dict)对象列表的要素数组转换为 scikit-learn 估计器使用的 NumPy/SciPy 表示形式。虽然 Python 的处理速度不是特别快,但 Python 的 dict 优点是使用方便,稀疏(不需要存储的特征),并且除了值之外还存储特征名称。类 DictVectorizer 实现了 “one...

2019-05-12 09:06:53 315

原创 SKLEARN--交叉验证

1.K折交叉验证KFold 将所有的样例划分为 k 个组,称为折叠 (fold) (如果 k = n, 这等价于 Leave One Out(留一) 策略),都具有相同的大小(如果可能)。预测函数学习时使用 k - 1 个折叠中的数据,最后一个剩下的折叠会用于测试。>> import numpy as np>>> from sklearn.model_sel...

2019-05-11 19:53:03 400

原创 206. 反转链表

# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solution(object): def reverseList(self, head):...

2019-05-11 16:47:37 95

原创 136. 只出现一次的数字

class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ #利用python库解决 # from collections import Counter ...

2019-05-11 16:47:31 55

原创 169. 求众数

class Solution(object): def majorityElement(self, nums): """ :type nums: List[int] :rtype: int """ #利用python库解法一 # from collections import Counter...

2019-05-11 16:47:25 54

原创 21. 合并两个有序链表

# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solution(object): def mergeTwoLists(self, l1, ...

2019-05-11 16:47:19 64

原创 231. 2的幂

class Solution(object): def isPowerOfTwo(self, n): """ :type n: int :rtype: bool """ #移位方法, 转化为二进制,如果数字是2的倍数,那么一定是第一位为1后面全是0 ...

2019-05-11 16:47:13 71

原创 88. 合并两个有序数组

class Solution(object): def merge(self, nums1, m, nums2, n): """ :type nums1: List[int] :type m: int :type nums2: List[int] :type n: int :rtype: No...

2019-05-11 16:47:08 89

原创 7. 整数反转7

class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ flag = 0 if x<0: flag =1 x = -x d...

2019-05-11 16:47:03 177

原创 78. 子集

class Solution(object): def subsets(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ #方法一# self.res = []# def dfs(nums,...

2019-05-11 14:41:33 88

原创 59. 螺旋矩阵 II

class Solution(object): def generateMatrix(self, n): """ :type n: int :rtype: List[List[int]] """ #方法一 # A, low = [], n*n+1 # while low &gt...

2019-05-11 14:41:26 111

原创 matplotlib可视化篇annotate(),text()--注释文本

1.matplotlib.pyplot.annotate()功能:在图中带有指向型文本注释信息,突显细节,官方项目地址,高级玩法,下面列出常用参数信息。text:str, 注释信息内容xy:(float,float), 箭头点所在的坐标位置xytext:(float,float), 注释内容的坐标位置weight: str or int, 设置字体线型,其中字符串从小到大可选项有{‘...

2019-05-11 14:41:19 10701

原创 算法评价方式整理(理论+代码)--代码后续更新

1.绝对误差与相对误差2.平均绝对误差3.均方误差4.均方根误差5.平均绝对百分误差6.Kappa统计7.识别准确度8.识别精确度9,召回率10.ROC曲线11.混淆矩阵...

2019-05-11 14:41:09 490

原创 557. 反转字符串中的单词 III

class Solution(object): def reverseWords(self, s): """ :type s: str :rtype: str """ data = s.split() #将字符串按照空格划分为单词列表 res = [] for item i...

2019-05-10 14:05:12 148

原创 589. N叉树的前序遍历

"""# Definition for a Node.class Node(object): def __init__(self, val, children): self.val = val self.children = children"""class Solution(object): def preorder(self, root...

2019-05-10 11:23:29 81

原创 590. N叉树的后序遍历

"""# Definition for a Node.class Node(object): def __init__(self, val, children): self.val = val self.children = children"""class Solution(object): def postorder(self, roo...

2019-05-10 11:22:37 92

原创 226. 翻转二叉树

# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution(object): ...

2019-05-10 11:16:00 66

原创 461. 汉明距离

class Solution(object):#方法一 def hammingDistance(self, x, y): """ :type x: int :type y: int :rtype: int """ num_x = self.geshi(self.Dec2Bin(x)) ...

2019-05-10 11:09:28 78

原创 617. 合并二叉树

# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution(object): ...

2019-05-10 10:50:18 85

原创 771. 宝石与石头

class Solution(object): def numJewelsInStones(self, J, S): """ :type J: str :type S: str :rtype: int """ #36ms 利用转化为列表的形式逐一进行比对 count = 0 ...

2019-05-10 10:39:16 79

原创 调参小技巧-KNN算法K值图像选取法

# 导入第三方模块import numpy as npfrom sklearn import neighborsimport matplotlib.pyplot as pltdef KNN_valuechoise(X_tain, y_train, K_num): # 设置待测试的不同k值# K = np.arange(1,np.ceil(np.log2(Knowledge...

2019-05-10 09:45:53 4115 2

原创 调参小技巧-DBSCAN参数选取方法

利用循环迭代一些参数变量选取最适合的参数1.初始数据处理部分,请自行对照调整,此处仅作为保持流程完整使用。# 读入第三方包from sklearn import preprocessing# 选取建模的变量predictors = ['Birth_Rate','Death_Rate']# 变量的标准化处理X = preprocessing.scale(Province[predi...

2019-05-10 09:17:24 37877 17

原创 调参小技巧-Kmeans聚类三大图像调参

1.拐点法(选取斜率突变点) 构造自定义函数,用于绘制不同k值和对应总的簇内离差平方和的折线图def k_SSE(X, clusters): # 选择连续的K种不同的值 K = range(1,clusters+1) # 构建空列表用于存储总的簇内离差平方和 TSSE = [] for k in K: # 用于存储各个簇内离差平方和 ...

2019-05-10 09:09:33 4051 2

redis数据库资源,免安装,带客户端与服务器端

redis数据库资源,免安装,带客户端与服务器端

2022-08-18

课程预约小程序.rar

课程预约小程序.rar

2021-11-11

番茄时钟(背景设置和铃声设置函数没写).rar

用于设定工作时间和休息时间两种状态对应的不同时长,未绑定用户登录

2021-11-11

抽奖转盘(未绑定用户信息).rar

抽奖转盘(未绑定用户信息).rar

2021-11-11

云开发实战图片识别.rar

对应云开发中的图片识别案例

2021-11-01

小程序实战-云相册.rar

对应小程序实战-云开发项目的项目代码

2021-11-01

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除