Friday, September 22, 2006

Data Predictable

Studying the data predictable problem recently, exactly it most looks like pattern recognize subject, it is interesting. We must find the relationships between elements independence seemingly, the probability and statistic methods are very effective to do this. I found that Markov Chain is also suitable for this, but it is complex, so I will implement the first release of software based data mining algorithm first.

I have just built the transaction matrix, the matrix present a group of interesting situations of users’ buys, a report will be generated later.

BBT Scenario Thought

In BBT(Buyer Buys Trace) system which based FP-Growth algorithm, there is a transaction matrix necessary first, but the original scenario for this algorithm is shopping cart analysis, and all the stuffs in the cart composed the pattern, then counting each cart to generate the frequent patterns, finally, retrieve the patterns which are satisfied minimum support and confidence, you will get the predict table. In my scenario, there is not a cart for each shopping-time, so I assumed that the shopping cart is a period for a week primely, but I realized that is not exactly, how can I determine this period? maybe I can separat the whole shopping process into many sub-process according to the buyer's purchase customs, if his buys is repeat then the process terminated, another process conituning, but the time axis is also consideration, it is very important, the Markov Chain is a classic model for events predicting according time axis.

Wednesday, September 20, 2006

Mail System

你现在看到的邮件是最古老同时又最先进的邮件系统,它通过fetchmail来收取邮件,通过procmail对邮件进行分类,通过mutt来管理邮件,使过w3m来直接查看HTML邮件,通过wvHtml将MS Doc或者其Office Doc转换成HTML再看,通过vi的编写邮件,最后通过esmtp来传递邮件,这些古老的工具分工合作完成邮件这一伟大的工作,在这一刻它们灵魂附体,伟大的Linux,Linus万岁!最要命的是,这封要命的邮件是当今世界上最帅的超帅哥发出来的,对于“帅”,他已经独孤求败很多年了。

Mutt中的邮件清单


在Mutt中用w3m查看HTML邮件

Latex and Unicode

终于将Latex + CJK + Unicode搞定,在Dapper下安装latex和CJK后(简单的安装可以参考http://my.opera.com/yonsan/blog/show.dml/96883),你有可能发现竟然无法处理如下文本:
\documentclass{article}
\usepackage{CJK}
\begin{CJK}{GBK}{song}
\begin{document}
我想输出中文!
\end{CJK}
\end{document}

郁闷了吧,你按照安装指南一步一步安装下来却还是不能处理中文,怪?不急,你需要检查一下你的文件的编码,因为Latex缺省是不能理UTF-8编码的,可以检查一下你的文件编码(用GEDIT就可以看了),如果是UTF-8的,则需要将其转换了GBK或GB,这样你再执行latex x.tex就可得到你想要的x.dvi;但是如果你的native编码是utf8的话,那么你将非常不方便,怎么办呢?在tex中是通过宏来扩展功能的,例如CJK就是用来处理亚系双字节语言的宏包,tex和emacs一样也是暂时独立支持utf8的(不过有一个好消息,听说emacs马上来出utf8版本了),在tex中有一个叫做ucs(http://www.unruh.de/DniQ/latex/unicode/)的包,就是用来支持utf-8编码的,你可以按照它提供的线路去安装这个包,在安装的过程中会用到freetype(www.freetype.org)提供的FreeType字体及其工具,你可能会无法找到ttf2tfm这一个工具,原因是它是freetype1中的字体工具,在Dapper下是无法找到的,我几乎找遍了相关网站想要找到它的源代码,但是没有办法找到,最后在http://packages.debian.org上找到了,在debain上查找的时候记得要找freetype1这个关键字才能找到。好了,你终于可以安装好utf8支持了(其中还有许多东东,自己慢慢搞,搞多了,tex的工作原理就出来了)。同时你也需要改一下你的源文件了,如下:

\documentclass{article}
\usepackage{CJK}
\begin{CJK}{UTF8}{song}
\begin{document}
我想输出中文!
\end{CJK}
\end{document}

记得将文件保存成utf8的格式,源文件只改了一个地方即引用了一个CJK下的叫做UTF8的宏,哦,原来CJK被用来设计支持UTF8的,只是真正的UTF8支持功能并不是CJK来实现的,这就是你为什么要安装ucs包的原因了,更进一步,你去查看CJK下UTF8中的相关文件,你会发现,它将song/kai/hei等中文字体都映像成了名为cyberbit的UTF8字体,这就是我们在安装ucs后为什么要安装cyberbit字体的原因了,当然,你如果有兴趣的话,你就可以去改动这些字体了(不过tex的字体与OS的字体不同一体系,在恶搞的过程中需要花些功夫了)。

Friday, September 15, 2006

Apriori算法

Apriori算法是使用最广泛的关联规则挖掘算法,所谓的关联规则可以通俗的理解为两个项或多个项之间存在联系的描述。这种关联性有很多方法得到,如数学公式、物理定理、化学变换式等,但是这些表示的联系都是精确联系,表明两者多多者之间存在唯一确定的关系,在现实生活中还存在很多没有唯一确定关系,但一定有联系的事物,比如用户的下一个购买跟他的已有购买之间的联系,这些是没有办法确定它们之间的联系的,但是可以模糊的表示他们的关系,而且这种关系的描述是无依据,或者说很感性的,于是出现以概率统计为基础的描述和模糊数学(好像已经正式成为了数学的一个分枝),而这几年由于互联网的白热化竞争发展导致大家都在提高服务质量,于是揣磨用户心理的活又被摆在面前,于是概率算法大行其道(当然还有其他算法)。

首先来精确了解一下Apriori算法:

关联规则:A => B | A 属于 I,且B 属于 I, 且A^B != 空 则称A与B是关联的,

支持度:support(A=>B) = P(A U B)
置信度:confidence(A=>B) = P(B | A)

强规则:同时支持最小支持度和最小置信度的规则称为强规则

设I = {i1, i2, ..., in}是项的集合,包含k个项的项集称为k-项集

频繁项集 frequent itemset : 出现频率 >= Total Transaction * min_sup //min_sup表示最小支持度

------------------------------------------------------------
单维关联规则:当关联规则中涉及的项只有一个时,即一推一
多维关联规则:当关联规则中涉及的项有多个时,即多推一
规则的抽象层次:主要是因为事物定义的多义性与范围作用

Apriori算法的核心是以出现频率为基础进行项的出现率比较,由1项推出2项。。。,直接K项全部被推完(一个规则中含有K项);其过程分为两步:一为连接(类矩阵运算),二为剪枝(去掉那些没必要的中间结果)。

具体算法,不在这里描述了,几乎所有的数据挖掘书籍中都有介绍。

Thursday, September 14, 2006

最近事件

终于将重装的机器搞定,TMD,竟然花了差不多3hours来搞定中文字体,最后发现原来是权限问题(最好设成755),犯了个低级的错误,有点不敢饶恕自己。

近几年来总是有人叫我搞他装机、修电脑、问怎么黑别人的电脑…… 虽然是个搞计算机的,但我必须声明了:我不会,同时请不要用鄙视的眼光看着我。另外也呼吁计算机专业的同学们不要为群众的质疑而妄自菲薄,有时候群众的无知性是很大的,这主要看是怎么训练他们的。

钱,是一个很好的东西,在这里工作我觉得很穷,因为这周围的同事大部分或实际或纸上都是千万百万的,他们算是赶上好时机了,想想在中国的IT人中的概率可能万分之一也难吧,做IT的竞争太大了。

很长一段时间都没有去写什么程序了,也不想写了,最近一直在看概率统计、隐马尔可夫型及贝叶斯信念网络方面的Paper,这是一种转变,一直没有机会让自己较大程度脱离代码的世界,现在是个好时机。对于亿万级数据的处理不是每个IT人都有机会去做的,我想我已经开始做互联网行业的Top Research了,这是很有意义的事情。

我们team在两天内连续开会,想要得出我们做research的roadmap,在alibaba习惯有完整的行动纲领(使命/愿景/目标),像整个公司的三元组是:
使命:让天下没有难做的生意。
愿景:做最伟大的企业,做102年的企业
目标:全球前3的网站,5~8年解决100万就业岗位,每天纳税一百万。。。。。

经过激烈的讨论,最后我们团队得出了三元组如下:
使命:Make IT simple and stupid
愿意:做电子商务技术的领先者
目标:领导行业技术,从专利、论文各方面突破

这也是我感觉很有意义的事,来这里之前我将Richard W. Hamming的<>读了多遍,希望能给我的research carreer一些帮助,最后发现在中国行动纲领之类的是绝对的杀手锏,Chairman Mao是将这一特点发挥到极限的人。

Wednesday, September 06, 2006

Microsoft, Who's In, Who's Out





















Who's In

Who's Out

Steven Sinofsky

Steven SinofskyThe Office exec joined the Vista project in March; he's senior VP of Windows and Windows Live engineering.
Jim Allchin

Jim AllchinRetiring in January. As platforms group co-president, he's been responsible for every big Windows release.
Amitabh Srivastava

Amitabh SrivastavaA programming expert, he retooled Windows development and is now VP in charge of the system kernel.
Brian Valentine

Brian ValentineA senior VP known for cheerleading, he led Windows XP but was reassigned this year after Vista deadline slips.
Ray Ozzie

Ray OzziePromoted in June from CTO to chief software architect. Ozzie is the person most responsible for the future of Windows. He came to Microsoft when it bought his company Groove Networks, and his computing roots stretch back to Lotus Notes, 1-2-3 and Visicalc.
Bill Gates

Bill GatesWill ease out of day-to-day management over the next two years as he devotes more time to his charitable foundation.



come from http://www.informationweek.com

Friday, September 01, 2006

Latex and CJK

在ubuntu6.06上安装latex + CJK有时候有点麻烦,为了简单,我没有使用它自带的包,而采用了直接安装的方式。
1、到http://www.tug.org/teTex/上下载最新版的teTex和texmf,我用的是3.0版本。
2、不要到网络上寻找什么安装指南,直接按照它的QuickInstall安装最快。
$ tar zxvf tetex-src-*.tar.gz
# mkdir -p /usr/local/tetex/share/texmf
# tar zxvf tetex-texmf-*.tar.gz -C /usr/local/tetex/share/texmf/
$ cd tetex-src-*
$ ./configure --prefix=/usr/local/tetex/ --enable-curses
$ make
# make world
记得将路径/usr/local/tetex/bin设到PATH中。
3、到http://cjk.ffii.org/上下载最新版的CJK。
4、进行编译后将生成的文件COPY过去即可:
# mkdir -p /usr/local/tetex/share/texmf/tex/latex/CJK
# mkdir -p /usr/local/tetex/share/texmf/doc/latex/CJK
# cp -R texinput/* /usr/local/tetex/share/texmf/tex/latex/CJK
# cp -R doc /usr/local/tetex/share/texmf/doc/latex/CJK
5、字体的安装参考:http://my.opera.com/yonsan/blog/show.dml/96883
6、安装完成后记得执行mktexlrs / texhash命令。
所有的第些操作最好完全用root完成。

参考:
http://linux.chinaunix.net/doc/chinese/2005-01-31/1030.shtml
http://my.opera.com/yonsan/blog/show.dml/96883