<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[leeshuheng的专栏]]></title><description><![CDATA[虚怀若谷 静若止水 顺其自然 无为无我]]></description><link>https://blog.youkuaiyun.com/leeshuheng</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; leeshuheng]]></copyright><item><title><![CDATA[R语言中使用tensorflow]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/71214505</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/71214505</guid><author>leeshuheng</author><pubDate>Fri, 05 May 2017 16:34:58 +0800</pubDate><description><![CDATA[1  TensorFlow
TensorFlow是一个使用数据流图(data flow graphs)进行数值计算的的开源软件库。图的节点代表数学计
算,图的边代表与之对应的多维数组(tensor)。这个思路正好与我设计的一个系统相反。tf灵活的架构使你用
单一API就能在台式机、服务器或移动设备上的多个CPU/GPU上进行计算。虽然tf最初是由Google的机器智
能研究机构 Googl]]></description><category></category></item><item><title><![CDATA[一个玩具—自制人脸识别]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/66967818</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/66967818</guid><author>leeshuheng</author><pubDate>Mon, 27 Mar 2017 09:08:16 +0800</pubDate><description><![CDATA[自己动手
OpenCV提供了一些人脸识别的工具, 比如FaceRecognizer。但自制一个人脸识别器是件挺好玩的事情,我用kNN实现了一个。]]></description><category></category></item><item><title><![CDATA[R语言中文情感分析包:cnSentimentR]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/54912801</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/54912801</guid><author>leeshuheng</author><pubDate>Tue, 07 Feb 2017 17:22:24 +0800</pubDate><description><![CDATA[该包使用jiebaR分词, svm[e1071]进行分类;
包括三个函数:cnsr.prepare,cnsr.train,cnsr.predict
目前还在开发中,功能不完整.

请见: https://github.com/leeshuheng/cnSentimentR]]></description><category></category></item><item><title><![CDATA[拓扑分析用于空间聚类]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/53019364</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/53019364</guid><author>leeshuheng</author><pubDate>Thu, 03 Nov 2016 10:55:52 +0800</pubDate><description><![CDATA[拓扑分析用于空间聚类


在工作中我会遇到这样的问题：
有一个城市中某种实体的地理位置信息，需要根据这些
实体的不同分布密度，来对这个城市进行区域划分。
那我们首先就要根据这些实体的位置进行聚类，
以便得到不同密度分布的实体集合，进一步得到
这个城市的区域划分。

我使用R语言中的TDA package对位置信息进行聚类。
实验的数据可以在这里下载：
http://down]]></description><category></category></item><item><title><![CDATA[使用R语言进行图像分类]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/52483800</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/52483800</guid><author>leeshuheng</author><pubDate>Fri, 09 Sep 2016 08:18:42 +0800</pubDate><description><![CDATA[使用R语言进行图像分类

本文使用R语言,应用SVM(高斯核)[3]算法对JPEG图片进行二类分。
SVM使用e1071包, 图像处理用imager包[1]。
数据使用的是Caltech 101中的Faces和BACKGROUND_Google两类数据[2]。
文章最后包含了实验的源代码。


这篇blog还有个pdf版本，可在 http://download.youkuaiyun.com/m]]></description><category></category></item><item><title><![CDATA[R 与 LaTeX]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/51319912</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/51319912</guid><author>leeshuheng</author><pubDate>Thu, 05 May 2016 09:02:30 +0800</pubDate><description><![CDATA[R 与 LaTeX

    R 是一种编程语言，广泛的用于数据挖掘和统计分析中。
她有很多实用的特性，比如她对LaTeX的支持。通过一些技术手段，
R语言可以生成LaTeX脚本，并把计算结果和可视化图形信息包括在
LaTeX脚本中。

    LaTeX 是一个排版系统，在数学和其他科学领域有着广泛的应用，
她最初是由Leslie Lamport开发。LaTeX把TeX作为格式化]]></description><category></category></item><item><title><![CDATA[使用pagerank计算商业服务网络中节点的重要性]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/51142402</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/51142402</guid><author>leeshuheng</author><pubDate>Wed, 13 Apr 2016 13:18:15 +0800</pubDate><description><![CDATA[现实世界中有很多商业服务，在服务中消费者和服务提供者构成了一个
网络（图）。大部分的服务网络都是无尺度网络，节点的degree是
幂律分布这样的无尺度分布。也就是说，很少部分服务商向大量的消费者
提供了大部分服务。在这样的无尺度网络中，很明显这少部分服务商是很重要的。
但他们的重要性需要一种度量。

    而且，随着共享经济的发展，线下线上的结合，有一些特定的服务网络在特定情况下
]]></description><category></category></item><item><title><![CDATA[POI推荐算法]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/45575855</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/45575855</guid><author>leeshuheng</author><pubDate>Fri, 08 May 2015 09:55:46 +0800</pubDate><description><![CDATA[POI推荐算法

这里介绍的算法是基于地点相似度的POI推荐。
该算法非常简单，在某些数据场景中十分有效。

基本的想法是：
    将POI名称作为标签处理
    一群用户对某个地点感兴趣，那么这群用户中的一部分人感兴趣的其他地点可能与该地点相似；

算法流程：
1）输入地点a, 用户集合X，地点集合Y、用户和地点关系集合
2）找到对a感兴趣的用户子集U；
    我们]]></description><category></category></item><item><title><![CDATA[红黑树(red black tree) Common Lisp 实现]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/11720211</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/11720211</guid><author>leeshuheng</author><pubDate>Mon, 16 Sep 2013 08:44:39 +0800</pubDate><description><![CDATA[学习Lisp的过程中，作为练习，我经常实现一些小东西。
这个红黑树就是我玩Lisp时搞出来的东西。作为一个代码
玩具，她的实现有些随意，尤其变量名。虽然只是
一个代码玩具，但她完整的实现和演示了红黑树的所有
主要功能。

红黑树的定义和C++实现可以看这里：
http://blog.youkuaiyun.com/leeshuheng/article/details/5937440
在C++版本]]></description><category></category></item><item><title><![CDATA[贝叶斯分类：Common Lisp实现]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/8671349</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/8671349</guid><author>leeshuheng</author><pubDate>Thu, 14 Mar 2013 08:34:57 +0800</pubDate><description><![CDATA[最近利用闲暇时间学习Common Lisp，作为编程实践，我实现了一个简陋的
贝叶斯分类器(bayesian)。这只是一个代码玩具，没有实际的工程价值。文章最后我
贴了这个贝叶斯的代码。


贝叶斯公式如下：



可以这样简单的推导出贝叶斯公式:



代码的流程，首先是统计样本数据；然后根据bayesian定理，创建一个
用于分类的模型；最后在用这个模型去对测试数据]]></description><category></category></item><item><title><![CDATA[数据挖掘： Apriori算法]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7871688</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7871688</guid><author>leeshuheng</author><pubDate>Thu, 16 Aug 2012 08:59:45 +0800</pubDate><description><![CDATA[数据挖掘： Apriori算法

1 概述

1.1 Apriori算法是由Rakesh Agrawal和Ramakrishnan Srikan
发明的一种数据挖掘算法。最初是解决找到transaction数据库中
不同item关联规则的问题。

2 算法

2.1 基本概念
I = {i1, i2, ..., im} 是由m个item组成的集合；
D是多个transact]]></description><category></category></item><item><title><![CDATA[数据挖掘：id3 算法]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7777722</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7777722</guid><author>leeshuheng</author><pubDate>Tue, 24 Jul 2012 08:54:48 +0800</pubDate><description><![CDATA[1 简述

1.1
    id3是一种基于决策树的分类算法，由J.Ross Quinlan
在1986年开发。id3根据信息增益，运用自顶向下的贪心策略
建立决策树。信息增益用于度量某个属性对样本集合分类的好坏程度。
由于采用了信息增益，id3算法建立的决策树规模比较小，
查询速度快。id3算法的改进是C4.5算法，C4.5算法可以
处理连续数据，采用信息增益率，而不是信息增益。]]></description><category></category></item><item><title><![CDATA[tcpdump抓取指定ip地址范围内的报文]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7729514</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7729514</guid><author>leeshuheng</author><pubDate>Mon, 09 Jul 2012 15:50:07 +0800</pubDate><description><![CDATA[用tcpdump可以抓取某个ip地址范围内的报文。例如：
抓取目的地址范围是192.168.1.10 ~ 192.168.1.100
的报文使用命令：
    tcpdump -n -nn 'ip[16] == 192 and ip[17] == 168 and ip[18] == 1 and ip[19] > 9 and ip[19] 

ip[16]是取得ip协议偏移为16的那个字节]]></description><category></category></item><item><title><![CDATA[k-means聚类算法]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7651196</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7651196</guid><author>leeshuheng</author><pubDate>Mon, 11 Jun 2012 09:03:09 +0800</pubDate><description><![CDATA[k-means作为一种聚类算法，是2006年评出的10大数据挖掘算法之一，
应用广泛。k-means这个名字恰到好处的说明了算法的工作原理。
该算法的目的就是要在n个对象中归纳出k种分类，而这是通过这样
一种聚类迭代过程实现的。
    （1）输入n个对象，并指定其中的k个为初始聚类中心；
    （2）分别计算n个对象和k个中心的相似度；
    （3）任意对象都有一个和其相似度最大]]></description><category></category></item><item><title><![CDATA[Boyer-Moore模式匹配算法]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7291053</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7291053</guid><author>leeshuheng</author><pubDate>Fri, 24 Feb 2012 15:45:41 +0800</pubDate><description><![CDATA[BM算法是由Robert S. Boyer和J Strother Moore在1977年
开发的一种快速字符串匹配算法。当然这里说的字符串
不全指'abcd'这样的可读字符组成的串，它可以是一片连续的内存。

在这里对该算法做简要描述。

设pat是一个模式串， 我们要在串string里搜索模式串pat是否存在。
设pat_len是pat的长度。设str_len是string的长度。]]></description><category></category></item><item><title><![CDATA[hash表C++实现]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7254980</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7254980</guid><author>leeshuheng</author><pubDate>Mon, 13 Feb 2012 14:53:35 +0800</pubDate><description><![CDATA[仿照SGI扩展中的hash_set和hash_map实现了下面两个简化的模板类。
她们的使用方法与stl中的容器类相似，支持插入，查找，删除，遍历等。
成员函数名称和语义基本与stl中的容器类一致。
迭代器的使用也与stl容器类的基本一致。

main.cpp中的代码是个简单的测试用例，我写的有点乱。

编译：g++ -g -W -Wall -Wextra -o mytest mai]]></description><category></category></item><item><title><![CDATA[崩溃时打印堆栈调用日志]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7241089</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7241089</guid><author>leeshuheng</author><pubDate>Wed, 08 Feb 2012 08:45:31 +0800</pubDate><description><![CDATA[在GNU/Linux编程中，我们可能会遇到程序因为内存访问错误而崩溃
或类似的问题。一般情况下，我们借助程序崩溃后生成的core文件
来定位引起程序崩溃的位置。
但有时我们无法在现场调试，只能依靠用户传回的一些日志文件的
内容来定位程序错误的位置。如果这时日志中包含程序崩溃时的栈
调用信息，那么对排除错误将会有些帮助。

使用backtrace函数和addr2line程序可以帮助我们]]></description><category></category></item><item><title><![CDATA[信号究竟发给谁]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/7022096</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/7022096</guid><author>leeshuheng</author><pubDate>Tue, 29 Nov 2011 09:19:31 +0800</pubDate><description><![CDATA[信号究竟发给谁

Linux中进程和线程本是一个东西，在内核中都是由task_struct结构标示。
两者都是由do_fork内核函数来启动，只是调用do_fork的参数不同。
如果进程只有一个线程，那么发给该进程的信号显然只能发给这个线程；
信号和信号处理函数是进程资源，那么当进程有多个线程时，信号究竟发给谁呢？
我做了3个实验来探讨这个问题，实验所采用的平台如下：

OS: f]]></description><category></category></item><item><title><![CDATA[Linux字符终端彩色进度条]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/6975762</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/6975762</guid><author>leeshuheng</author><pubDate>Wed, 16 Nov 2011 10:01:33 +0800</pubDate><description><![CDATA[我在Linux字符终端上实现了两种有趣的彩色进度条。
一种是采取渐进打印的动画效果，另一种是循环打印。
用C语言和shell脚本实现了这两种方式，我不怎么
擅长shell脚本，所以代码写得比较凌乱。两个程序
没事儿的时候可以拿来解闷。
具体的实现方式可以看后面的代码。

测试环境：
OS:    fedora 11
gcc:   Red Hat 4.4.0-4
shell: b]]></description><category></category></item><item><title><![CDATA[数字转换成指定进制的数字字符串]]></title><link>https://blog.youkuaiyun.com/leeshuheng/article/details/6967974</link><guid>https://blog.youkuaiyun.com/leeshuheng/article/details/6967974</guid><author>leeshuheng</author><pubDate>Mon, 14 Nov 2011 11:12:51 +0800</pubDate><description><![CDATA[下面的函数将一个long型的整数转换为某个指定进制的数字字符串。
正数和0的前面输出'+'号，负数的前面输出'-'号。
如果指定8进制字符串则以'0'开头；如果指定16进制，则以'0x'
或'0X'开头。
可以指定类似16进制的数输出字母的大小写。

编译：
    g++ -g -W -Wall -Wextra -o mytest main.cpp
执行：
    ./myte]]></description><category></category></item></channel></rss>