- 博客(30)
- 收藏
- 关注
原创 [leetcode]450. Delete Node in a BST
题目链接:https://leetcode.com/problems/delete-node-in-a-bst/#/descriptionGiven a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference
2017-03-28 11:40:28 351 1
原创 [leetcode]375. Guess Number Higher or Lower II
题目链接:https://leetcode.com/problems/guess-number-higher-or-lower-ii/#/descriptionWe are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which
2017-03-27 10:07:46 533
原创 [leetcode]388. Longest Absolute File Path
题目链接:https://leetcode.com/problems/longest-absolute-file-path/#/descriptionSuppose we abstract our file system by a string in the following manner:The string "dir\n\tsubdir1\n\tsubdir2\n\t\t
2017-03-26 13:36:49 250
原创 [leetcode]279. Perfect Squares
题目链接:https://leetcode.com/problems/perfect-squares/#/descriptionGiven a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.F
2017-03-25 10:43:12 217
原创 [leetcode]11. Container With Most Water
题目链接:https://leetcode.com/problems/container-with-most-water/#/descriptionGiven n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines
2017-03-25 10:21:11 175
原创 [leetcode]162. Find Peak Element
题目链接:https://leetcode.com/problems/find-peak-element/#/descriptionA peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak el
2017-03-24 13:30:28 282
原创 [leetcode]289. Game of Life
题目链接:https://leetcode.com/problems/game-of-life/#/descriptionAccording to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the Brit
2017-03-23 10:30:56 221
原创 [leetcode]116. Populating Next Right Pointers in Each Node
题目链接:https://leetcode.com/problems/populating-next-right-pointers-in-each-node/#/descriptionGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right;
2017-03-22 10:56:40 212
原创 [leetcode]474. Ones and Zeroes
题目链接:https://leetcode.com/problems/ones-and-zeroes/#/descriptionIn the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.F
2017-03-21 10:21:01 333
原创 误差 偏差 方差
以机器学习算法来说,其泛化误差可以分解为两部分,偏差(bias)和方差(variance)。这个可由下图的式子导出(这里用到了概率论公式D(X)=E(X^2)-[E(X)]^2)。偏差指的是算法的期望预测与真实预测之间的偏差程度,反应了模型本身的拟合能力;方差度量了同等大小的训练集的变动导致学习性能的变化,刻画了数据扰动所导致的影响。这个有点儿绕,不过你一定知道过拟合。<im
2017-03-20 19:08:44 750
原创 随机森林算法原理小结
随机森林算法 理解了bagging算法,随机森林(Random Forest,以下简称RF)就好理解了。它是Bagging算法的进化版,也就是说,它的思想仍然是bagging,但是进行了独有的改进。我们现在就来看看RF算法改进了什么。 首先,RF使用了CART决策树作为弱学习器,这让我们想到了梯度提示树GBDT。第二,在使用决策树的基础上,RF对决策树的建立做了改
2017-03-20 18:56:38 2481
转载 集成学习原理小结
集成学习(ensemble learning)可以说是现在非常火爆的机器学习方法了。它本身不是一个单独的机器学习算法,而是通过构建并结合多个机器学习器来完成学习任务。也就是我们常说的“博采众长”。集成学习可以用于分类问题集成,回归问题集成,特征选取集成,异常点检测集成等等,可以说所有的机器学习领域都可以看到集成学习的身影。本文就对集成学习的原理做一个总结。1. 集成学习概述
2017-03-20 17:58:30 816
原创 [leetcode]75. Sort Colors
题目链接:https://leetcode.com/problems/sort-colors/#/descriptionGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in
2017-03-20 10:50:54 229
原创 [leetcode]313. Super Ugly Number
题目链接:https://leetcode.com/problems/super-ugly-number/#/descriptionWrite a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in
2017-03-18 11:12:12 269
原创 [leetcode]64. Minimum Path Sum
题目链接:https://leetcode.com/problems/minimum-path-sum/#/descriptionGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all num
2017-03-17 10:03:08 234
原创 [leetcode]48. Rotate Image
题目链接:https://leetcode.com/problems/rotate-image/#/descriptionYou are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do th
2017-03-16 11:24:09 207 1
原创 [leetcode]300. Longest Increasing Subsequence
题目链接:https://leetcode.com/problems/longest-increasing-subsequence/#/descriptionGiven an unsorted array of integers, find the length of longest increasing subsequence.For example,Given[10,
2017-03-15 14:42:06 290
原创 [leetcode]240. Search a 2D Matrix II
题目链接:https://leetcode.com/problems/search-a-2d-matrix-ii/#/descriptionWrite an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:
2017-03-15 09:57:32 204 1
原创 [leetcode]416. Partition Equal Subset Sum
题目链接:https://leetcode.com/problems/partition-equal-subset-sum/#/descriptionGiven a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such t
2017-03-14 20:22:54 259
原创 [leetcode]215. Kth Largest Element in an Array
题目链接:https://leetcode.com/problems/kth-largest-element-in-an-array/#/descriptionFind the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order
2017-03-14 17:26:55 400
原创 [leetcode]334. Increasing Triplet Subsequence
题目链接:https://leetcode.com/problems/increasing-triplet-subsequence/?tab=DescriptionGiven an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Form
2017-03-12 16:18:47 245
原创 [leetcode]380. Insert Delete GetRandom O(1)j
题目链接:https://leetcode.com/problems/insert-delete-getrandom-o1/?tab=DescriptionDesign a data structure that supports all following operations in average O(1) time.insert(val): Inserts an
2017-03-12 14:20:02 264
转载 随机森林特征选择
随机森林具有准确率高、鲁棒性好、易于使用等优点,这使得它成为了目前最流行的机器学习算法之一。随机森林提供了两种特征选择的方法:mean decrease impurity和mean decrease accuracy。平均不纯度减少----mean decrease impurity 随机森林由多个决策树构成。决策树中的每一个节点都是关于某个特征的条件,为
2017-03-11 11:48:38 7348
原创 bootstrap bagging boosting adboost oob
bootstrap、bagging、boosting和adaboost是机器学习中几种常用的重采样方法。其中bootstrap重采样方法主要用于统计量的估计,bagging、boosting 和 adaboost方法则主要用于多个子分类器的组合。一、bootstrap:估计统计量的重采样方法 bootstrap方法是从大小为n的原始训练数据集中随机选择n个样本点
2017-03-11 10:29:56 582
原创 [leetcode]491. Increasing Subsequences
题目链接:https://leetcode.com/problems/increasing-subsequences/?tab=DescriptionGiven an integer array, your task is to find all the different possible increasing subsequences of the given array, and
2017-03-06 11:10:25 449
原创 [leetcode]390. Elimination Game
题目链接:https://leetcode.com/problems/elimination-game/?tab=DescriptionThere is a list of sorted integers from 1 to n. Starting from left to right, remove the first number and every other number af
2017-03-04 10:58:27 311
原创 [leetcode]341. Flatten Nested List Iterator
题目链接:https://leetcode.com/problems/flatten-nested-list-iterator/?tab=DescriptionGiven a nested list of integers, implement an iterator to flatten it.Each element is either an integer, or
2017-03-03 13:43:23 292
原创 [leetcode]173. Binary Search Tree Iterator
题目链接:https://leetcode.com/problems/binary-search-tree-iterator/?tab=DescriptionImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BS
2017-03-03 13:17:01 180
原创 [leetcode]482. License Key Formatting
题目链接:https://leetcode.com/problems/license-key-formatting/?tab=DescriptionNow you are given a string S, which represents a software license key which we would like to format. The string S is com
2017-03-03 11:40:14 245
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人