- 博客(19)
- 资源 (5)
- 收藏
- 关注
原创 leetcode50_Pow(x, n)
一.问题描述Implement pow(x, n).实现指数乘法。二.代码编写首先想到的其实就是把n不断拆分成n/2,但是想歪了,可能沉浸在大数乘法那个题里,然后发现其实小数乘大数比两个相等的数运算复杂度低一点,所以就否定了这个想法。但看了tags是二分的思想,后来一想其实重点不在于每次运算的复杂度,而在于二分能将运算的次数由O(N)降低到O(logN)。所以其实这
2016-11-30 21:29:44 398
原创 xgboost调参
Xgboost调参英文版参考:https://www.analyticsvidhya.com/blog/2016/03/complete-guide-parameter-tuning-xgboost-with-codes-python/ Xgboost经常被用作许多数据科学家的终极武器—有多厉害不用强调了。但是使用xgboost很简单,提高其性能就很难了。算法有太多的参数,为了提高
2016-11-30 19:11:51 1925
原创 统计学习方法(五)AdaBoost
一.提升方法boosting 如果我有写过集成方法的话[没有的话看这篇集成学习理论],集成方法的一大类就是boosting,其基本思想就是不断地在迭代过程中训练BaseModel,并增加误分样本的权重,直到达到停止条件后,组合BaseModel。从集成学习的理论我们知道boosting在组合过程中会增大模型的variance,所以BaseModel必须是低bias但低varian
2016-11-30 11:46:38 779
原创 ★leetcode45_Jump Game II
一.问题描述Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.
2016-11-25 17:07:27 327
原创 ★leetcode44_Wildcard Matching
一.问题描述Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching sh
2016-11-24 09:55:52 430
原创 ★leetcode43_Multiply Strings
一.问题描述实现字符串的乘法,不能直接将字符串转化成int哦~二.代码编写首先想到的方法就是根据我们平时手算乘法的方法来计算,本质上就是移位相乘相加~但是时间复杂度是O(N^2)。代码如下:'''@ author: wttttt at 2016.10.29@ problem description see: https://leetcode.com/prob
2016-11-22 20:14:11 531
原创 leetcode42_Trapping Rain Water
一.问题描述Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,
2016-11-20 16:48:59 266
原创 leetcode41_First Missing Positive
一.问题描述给定一组integers,找出其中最小的缺失的正整数值,要求时间复杂度为O(n),空间复杂度为O(1)。二.代码编写时间复杂度为O(n)意味着不能直接对list进行排序O(NlogN),空间复杂度为常数意味着不能新建一个list。常数空间,我们应该想到直接swap,将相应得到数字m放到list的(m-1)的位置上。全部交换完毕后,返回list中第一个不满
2016-11-20 15:58:15 319
原创 [email protected]
近期要看的:一.机器学习算法相关数学之美番外篇:平凡而又神奇的贝叶斯方法机器学习知识点其中包含了很多算法,慢慢的当做对统计学习方法的回顾总结来看吧。生成模型与判别模型从最大似然到EM算法浅解 当时看统计学习方法,觉得理解了许多,但是不应用转眼间又忘了,这篇当做温习,顺便可能可以从另一个角度加深理解。使用sklearn进行集成学习——理论 ensemble这么常用
2016-11-17 15:21:24 435 1
转载 机器学习中的范数规则化
机器学习中的范数规则化之(一)L0、L1与L2范数[email protected]://blog.csdn.net/zouxy09 今天我们聊聊机器学习中出现的非常频繁的问题:过拟合与规则化。我们先简单的来理解下常用的L0、L1、L2和核范数规则化。最后聊下规则化项参数的选择问题。这里因为篇幅比较庞大,为了不吓到大家,我将这个五个部分分成两篇博文。知识有限
2016-11-17 15:08:16 373
原创 leetcode39&40_Combination Sum& CombinationSumII
一.问题描述Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C un
2016-11-12 11:51:43 290
原创 python之Thread和multiprocessing
下面的每个例子虽然都只给了代码,但是代码我都做了非常非常详细的注释,相信我们都能从其中得到知识的提升!~1.multithread_面向过程import threadingimport timeimport os# a program to simulate selling tickets in multi-thread way# u may realize that this i
2016-11-11 14:00:35 4707
原创 python_Jupyter环境配置
IPython是一个 Python 的一个交互式 shell,它提供了很多内建的函数。Jupyter Notebook是IPython的一个Web接口,其实它也支持其它语言。它可以展现富文本,使得整个工作可以以笔记的形式展现、存储,适合做数据分析,交互编程和学习。本文纪录了在CentOS上搭建Jupyter Notebook的步骤。参考网址:http://www.linuxdiyf.com
2016-11-10 16:32:02 20159 1
原创 kaggel入门比赛_HousePrices
kaggle入门系列比赛HousePrices,该比赛是一个经典的回归问题,预测房价,这个比赛我用来熟悉kaggle,熟悉基本的数据挖掘流程,主要是特征工程,包括常见的缺失值填补,categorial特征的处理,其实主要就是熟悉用python的pandas包对数据进行预处理。第一次尝试的过程我主要是参考了Regularized Linear Models这篇kernel,它对数据的处理就是一些
2016-11-08 20:29:50 4374
原创 leetcode36&37_SudukuSolver
36题:一.问题描述Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.
2016-11-07 15:05:09 332
原创 leetcode34_Search for a Range
一.问题描述Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target i
2016-11-01 09:33:31 263
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人