Siyao's Blog


  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 搜索

【leetcode】53. Maximum Subarray

发表于 2017-03-13 | 分类于 leetcode
字数统计: 681 | 阅读时长 ≈ 3
题目Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example: given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] has the largest sum = 6. 问题陈述:求一个数组的最大连续子数组,连续和最大的子数组 题目思路: 遍历,复杂度O(n^2) 分治法,《算法导论》第四章讲过 把数组看作A[low..hig ...
阅读全文 »

GIS

发表于 2017-03-07
字数统计: 1,723 | 阅读时长 ≈ 6
OpenStreetMap 开放街道图(OpenStreetMap,简称OSM)是一个网上地图协作计划,目标是创造一个内容自由且能让所有人编辑的世界地图,其osm数据开源,可以自由下载使用。https://www.openstreetmap.org/ 北京osm数据beijing.osm中国osm数据china.osm 优势 地图数据开源,人人可以编辑,并且可以完整的下载,部署私有的地图服务器 内容丰富,比起ESRI Shapefiles的点、面、线,支持更多复杂的元素 生态圈活跃,从地图数据、数据库、地图渲染、瓦片服务器、前端API,到桌面、Web地图设计工具,具有大量优秀的开源组件 os ...
阅读全文 »

【leetcode】500. Keyboard Row

发表于 2017-03-07 | 分类于 leetcode
字数统计: 758 | 阅读时长 ≈ 4
题目Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below. Example 1:Input: ["Hello", "Alaska", "Dad", "Peace"]Output: ["Alaska", "Dad"] Note: You ma ...
阅读全文 »

【leetcode】476 number complement

发表于 2017-03-05 | 分类于 leetcode
字数统计: 539 | 阅读时长 ≈ 2
刷题第二天,好巧哦又是一道bit manipulation的 题目:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note:The given integer is guaranteed to fit within the range of a 32-bit signed integer.You could assume no leading zero bit in the inte ...
阅读全文 »

决策树(三):多变量决策树

发表于 2017-03-05
字数统计: 146 | 阅读时长 ≈ 1
前面讲到的都是单变量决策树,即每次只选取一个属性进行划分其实就是确定分类边界,且单变量决策树的决策边界都是平行于坐标轴,如下图 有些时候我们希望用斜线甚至曲线去进行划分以得到更好的泛化能力: 这种“斜划分”的方式就是多变量决策树,划分依据不再是单个属性,而是一个形如$\sum\limits_{i=1}^dw_ia_i=t$的线性分类器,${w_i}$和t是需要学习的参数
阅读全文 »

决策树(二):连续值和缺失处理

发表于 2017-03-05 | 分类于 机器学习
字数统计: 375 | 阅读时长 ≈ 1
连续值离散化连续值属性离散化,二分法对于连续属性a,有n个样本,考察包含n-1个区间的中点作为候选的划分点: 信息增益 选取能够获得信息增益最大的点t进行二分注意 注意连续值属性可多次作为划分节点(划分值不同),每次划分出两个分支;但离散值属性只可划分一次,分出多个分支。 缺失值有些样本缺失某些属性值,如图:如果只要样本有缺失的值就舍弃,会浪费大量数据。 问题 如何在缺失值的数据集上进行属性划分。也就是对于某一个或几个属性,样本有缺失的值,我们如何计算信息增益等指标进行划分属性的选取。 给定划分属性,若样本在该属性上缺失值,如何划分。也就是选好了划分属性,对于缺失该的样本,如何将其归类。 ...
阅读全文 »

决策树(一):基础

发表于 2017-03-04 | 分类于 机器学习
字数统计: 1,038 | 阅读时长 ≈ 4
基本流程 使用不熟悉的数据集合,从中提取出一系列规则,能够对新数据进行分类 极大化信息增益$a_* = argmax_{a\in A}{Gain(D,a)}$ 构建决策树伪代码createBranch(): 检测数据集中的每个项是否属于同一个分类: if so return 类标签 else 寻找划分数据集的最好特征*** 划分数据集 创建分支节点 for 每个分支节点,递归调用createBranch()函数 return 分支节点 关键显然,构建决策树的关键是寻找划分数据集的最好特征, ...
阅读全文 »

【leetcode】461 HammingDistance

发表于 2017-03-04 | 分类于 leetcode
字数统计: 357 | 阅读时长 ≈ 2
从今天开始每天刷一道LeetCode算法题,可不能再偷懒了 题目:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. $$0 \leq x, y < 2^{31}$$Note:0 ≤ x, y < 231.Example:Input: x = 1, y = 4Out ...
阅读全文 »

ssh-key

发表于 2017-03-04 | 分类于 tips
字数统计: 193 | 阅读时长 ≈ 1
hexo发布博客 “enter passhrase for key ‘…/rsa_id’”用hexo在github上搭建好自己的博客接下来发布博客,输入 $hexo d 每次都会出现“enter passphrase for key ‘…/id_rsa’的问题: 原因:可能在之前部署博客生成ssh秘钥的时候误为私钥id_rsa设置了密码 解决方法:重置ssh私钥密码 [zsy@desktop]$ cd ~/.ssh/[zsy@desktop]$ ssh-keygen -f id_rsa -p #修改ssh私钥passphraseEnter new passphrase (empty fo ...
阅读全文 »

hello world

发表于 2017-03-04 | 分类于 test
字数统计: 74 | 阅读时长 ≈ 1
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post$ hexo new "My New Post" More info: Writing Run server$ hexo server More info ...
阅读全文 »
1…1112
Siyao

Siyao

siyao小朋友画圈圈的地方

120 日志
25 分类
32 标签
© 2017 — 2018 Siyao
由 Hexo 强力驱动
|
主题 — NexT.Pisces
| Site words total count: 222.8k
访问人次 次 总访问量 次