- 博客(21)
- 资源 (5)
- 收藏
- 关注
原创 kaggle_1_环境配置
需要安装的基本就是各种科学计算环境的python包以及ipython。1.安装一些包依赖:yum -y install blas blas-devel lapack-devel lapackyum -y install seaborn scipyyum -y install freetype freetype-devel libpng libpng-devel2.接着安装所需的包(使用
2016-10-31 16:04:20 5245
原创 leetcode33_Search in Rotated Sorted Array
一.问题描述Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the
2016-10-29 17:35:54 250
原创 leetcode32_Longest Valid Parentheses
一.问题描述Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring
2016-10-29 09:54:44 217
翻译 An Introduction to Conditional Random Fields[条件随机场介绍]
An Introduction to Conditional Random FieldsBy Charles Suttonand Andrew McCallum文献网址:http://homepages.inf.ed.ac.uk/csutton/publications/crftut-fnt.pdf[译]条件随机场介绍By wttttt2.Modeling建模本节我们从建模
2016-10-27 16:48:10 2480
原创 gensim的word2vector测试_基于中文wiki语料
1.安装gensim pip install gensim会报一个问题,可以直接忽略。2.下载wiki语料wget https://dumps.wikimedia.org/zhwiki/latest/zhwiki-latest-pages-articles.xml.bz23.用WikiExtractor抽取正文文本nohup python WikiExtractor.py -cb
2016-10-27 15:11:13 1624
原创 leetcode29_Divide Two Integers
一.问题描述Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.实现两个int的除法,代码中不能使用乘、除和取余操作,溢出时返回max_int。二.代码编写 最基
2016-10-24 20:48:46 292
原创 leetcode28_Implement strStr()
一.问题描述Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.二.代码编写 最基本的想法就是,为两个字符串指定两个指针,相同则两个指针后移,不同则子串回退到0,母串往前
2016-10-24 19:07:08 165
原创 leetcode27_Remove Element
一.问题描述Given an array and a value, remove all instances of that valuein place and return the new length.Do not allocate extra space for another array, you must do this in place with constan
2016-10-24 18:51:30 167
翻译 [译]浮点数的危害
The Perils of FloatingPointby Bruce M. BushCopyright (c) 1996 Lahey Computer Systems, Inc. Permission to copy isgranted with acknowledgement of the source.原文参见 The Perils of Floating Point[译]
2016-10-24 11:18:20 499
原创 [python官方文档]10&11标准库概述(附generator介绍
首先,对一些大型模块,可以使用内置函数:1)dir(os) 得到os模块内部的所有函数2) help(os)返回os模块的帮助信息os旗下的:os.chdir() os.getcwd()【get current working directory】sys旗下的:sys.argv[x]【返回命令行调用的第x个参数,其中第0个默认为模块名,sys.argv为list】time旗下
2016-10-22 17:18:20 268
原创 leetcode23_Merge k Sorted Lists
一.问题描述Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.合并k条有序链表,返回一条有序链表二.算法思想有两种思路:1)利用二路归并的思想,将k条有序链条两两进行二路归并,一共需要logk次合并后得到最终链表。显然
2016-10-20 21:43:04 189
原创 leetcode22_Generate Parentheses
一.题目描述Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()
2016-10-19 10:01:20 194
原创 leetcode21_Merge Two Sorted Lists
一.问题描述 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. #合并两个有序链表,当然要求结果也是有序链表#Defini
2016-10-17 14:25:21 169
原创 [python官方文档]9类
#这只是一个简要的个人回顾,慎看作用域和命名空间:命名空间(命名-对象の映射)built-in-names:内置-函数、变量、类型etc【解释器启动-解释器关闭】模块中的函数,变量,类【module imported-一般是解释器退出】类中的成员变量,成员函数【类定义-】方法中的变量【方法被调用-方法返回/遇到未被处理的异常】作用域:从内向外搜索,知道最外层的内
2016-10-17 10:35:27 249
原创 统计学习方法(四) 支撑向量机
又再一次看到SVM这一章了啊,其实每次想起SVM我内心都是十分?敬畏(误)?的,其原始思想倒是易懂,但其中涉及到的对偶问题转换,凸二次规划问题,核函数,正定核,SMO,这些用法里面每一个都包含太多公式,太多推导。对于其中的一些数学思想,我以为自己不应当去深究了,但同时我又对知识充满了?渴求(大误)?,额。。一.支撑向量机模型:超平面w*x+b=0, 决策函数f(x) = sign(w*x+
2016-10-13 10:55:22 309
原创 [python官方文档]8错误和异常
#这只是一个简要的个人回顾,慎看错误和异常:1.语法错误:2.异常: 在语法上正确,但运行时可能引发错误。常见exception:ZeroDivisionEroor NameError TypeError3.异常处理:try catch else finally没有被捕获到的异常会传到上一级去handle,所以只要在合适的地方去trycathc就好了如果try过
2016-10-11 21:59:01 245
原创 统计学习方法(三) logisitic回归与最大熵模型
前言:本文实际为阅读众多LR相关资料总结而成,其中logistic回归--方法与应用 一书使我受益匪浅。在机器学习实战的逻辑斯蒂回归中我们有讲到,logistic模型就是使用sigmoid函数拟合条件概率,具体地:此前,我的主要理解仅限于sigmoid函数及其函数图像形式。但是为什么使用这个函数来拟合自变量和因变量之间的关系呢?一.线性回归模型LRM线性回归模型常用于定
2016-10-09 15:46:06 2271
原创 [python官方文档]5数据结构
#这只是一个简要的个人回顾,慎看list操作:len popappend insertextend +[:] delremoveclear indexcount sortcopy reverse5.1.1 stack appendpop5.1.2 not suitable for queue --->collections.deque(涉及到
2016-10-08 20:24:48 255
原创 【python官方文档】深入理解python函数定义
开始看python官方文档啦!中文的,附上地址: python官方文档_中文一.默认参数值:对于稍有些python基础的同学们都会使用Python的函数定义和函数的默认值吧,毕竟跟其他语言也是大同小异的。但是你知道默认参数值是如何使用的吗?“默认值只被赋值一次 ”。这个性质使得默认值是可变对象时会有所不同。看下面的例子:def f(a, L=[]): L.append(a)
2016-10-08 15:47:18 2073
原创 统计学习方法(二)决策树
注:这篇文章标题虽然是>系列,但实际上我写的时候是脱离书本写的,距离上一次看那一章节也有一段时间了,所以主要作用是自我巩固、理解,大概会想到哪写哪吧~一.DT概述决策树是if-then规则,是对条件概率的学习。根据统计学习方法,我们考虑其三要素对应是什么:模型-----一种描述对实例进行分类的树形结构。策略-------与训练数据矛盾较小的决策树,同时有很好的泛化能力。实质
2016-10-05 16:06:41 520
原创 leetcode15&16_3Sum&4Sum
一.问题描述Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must
2016-10-05 15:17:28 237
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人