
Topic Model
xyqzki
wahahahaahahahahah
展开
-
(zz)理解LDA,latent dirichlet allocation- David Blei
若公式显示有问题请复制链接到新TAB重新打开听说国外大牛都认为LDA只是很简单的模型,吾辈一听这话,只能加油了~另外这个大牛写的LDA导读很不错:http://bbs.byr.cn/#!article/PR_AI/2530?p=1一、预备知识: 1. 概率密度和二项分布、多项分布,在这里 2. 狄利克雷分布,在这里,主要内容摘自《Pa转载 2013-08-31 20:27:02 · 1558 阅读 · 0 评论 -
sparse coding理解
ref: yu kai cvpr12 tutorial http://blog.youkuaiyun.com/jwh_bupt/article/details/9902949 典型的sparse coding的过程分为训练和测试。 Training:给定一些训练样本(training samples)[ x1, x2, …, xm(in Rd)],学习一本字转载 2013-10-22 16:02:17 · 944 阅读 · 0 评论 -
批量replace method python
ref: http://stackoverflow.com/questions/10017147/python-replace-characters-in-stringTry regular expressions: a = re.sub('[.!,;]', '', a)You can also built an expression dynamically转载 2013-10-29 23:32:24 · 1495 阅读 · 0 评论 -
python 建立vocabulary,包括去标点,split
http://www.cnblogs.com/sunada2005/archive/2013/05/01/3053377.html一、统计txt中英文单词出现的次数 1 import string #处理文本时,需要去除跟在单词后的标点。所以用到string模块 2 3 filename=open('sampleFile.txt')转载 2013-10-29 22:56:41 · 6804 阅读 · 0 评论 -
自己对gradient的误解-----理解gradient descend算法
首先,对于f(x)的gradient,如果x是k维,则gradient就是k维,就是在x的domain里,gradient的方向会使得f(x)的增加最快。注意这里的gradient并不是两个cross black point 之间的方向,这个方向是3维的。而是在2维投影平面中的一个方向,即转载 2013-10-23 22:11:44 · 1721 阅读 · 0 评论 -
topic model 预处理步骤
1. del punctuation2. lower case3. del stopword4. len(s)>15. del infrequent word原创 2013-10-30 10:56:44 · 807 阅读 · 0 评论 -
解graph model
1. 分清hidden variable 和 parameterhidden variable 是要learn的,parameter估计就行2. 用MAP 求 hidden variable用MLE 做parameter estimation原创 2013-11-29 20:57:26 · 770 阅读 · 0 评论 -
variational inference
theta: org parameter, theta_P: variational parameter1. goal: 估计p(z|x)2. 找p(x|theta)likelihood的lower bound,再max这个lower bound 就能找到 p(z|x)的近似分布q(z|theta_P)3. 找complete likelihood ln[p(x,z转载 2013-12-19 10:22:33 · 7145 阅读 · 0 评论 -
判断query 与哪些document相关,用cos sim 而不用 euclidean dis
因为 每个 document 与query 都表示成了 tif原创 2014-04-14 16:24:54 · 801 阅读 · 0 评论 -
ubuntu如何使用david blei 的hLDA code
因为blei的code是在mac写的,在ubuntu上,我们需要对Makefile 进行如下修改,1. CFLAGS_MAC中的-fast 删除2. MAC_LDFLAGS = -lgsl -lgslcblas 后面加上 -lm原创 2014-12-27 23:16:19 · 2102 阅读 · 1 评论 -
SVM Classification python example using sklearn 分类例子
1. No cross validationref: http://stackoverflow.com/questions/16927964/how-to-calculate-precision-recall-and-f-score-with-libsvm-in-pythonfrom sklearn import svmfrom sklearn import metricsfr原创 2015-02-07 21:19:51 · 3371 阅读 · 0 评论 -
统计中parameter estimation 的方法总结。Topic Model需要注意的
个人总结:统计中参数估计有四种方法点估计MLEMAP加入参数的prior 信息,可以避免overfitting,还可以加入extra knowledge。称为Occam’razorBayesian Inference这种方法不像MLE,MAP将参数看成未知的常量,而是看成随机变量,求出其后验分布的具体形式p(θ|X)p(\theta|X),然后用E(θ|X)E(\theta|X)作为估计值。通常原创 2015-05-20 22:21:21 · 2527 阅读 · 0 评论 -
看topic modelling paper 要分成两类看
1. topic modelling 本身的理论,关注nips,理论问题包括sparse, inference,prior选择,model的比较2. topic modelling 在product review中的应用原创 2013-09-26 16:08:34 · 775 阅读 · 0 评论 -
generative model 与 discriminative model 进一步理解
g model 就是 意淫p(x,y)的产生过程,这个过程可以任意复杂,只要能够inference出来。d model 就是 有些observation如果用 generative model来意淫出来的话,会导致model过于复杂,inference是个问题,所以我们可以alleviate这些observation,将其视作已经生成好了的,看做已知的东西,即graphical model 中原创 2013-10-10 23:30:43 · 1449 阅读 · 0 评论 -
对于observation or feature 的两种利用方式
对于text dataset, 每篇doc 一般都有对应的metadata(side information), 还有容易得到的一些feature e.g. pos, np chunking, wordnet1. word 本身2. metadata3. feature都算是我们的observation, 利用的方式有两种,第一种就是用generative model, 意淫这原创 2013-10-10 23:11:40 · 1158 阅读 · 0 评论 -
pLSA与LDA中的parameter estimation笔记
1. pLSA中 是用MLE or MAP来做parameter estimation的,即把p(z|w) 看做a unknown function of z, i.e. f(z), 求一个optimal z. 这个是point estimator2. 在LDA中,求p(z|w)是用bayesian inference。 即求p(z|w)的分布,将其看做一个random variable,不同原创 2013-08-31 23:24:46 · 1007 阅读 · 0 评论 -
Dirichlet Process & Dirichlet Distribution
狄利克雷过程(dirichlet process )是目前变参数学习(non parameter)非常流行的一个理论,很多的工作都是基于这个理论来进行的,如HDP(hierarchical dirichlet process)。下面我们谈谈dirichlet process的五种角度来理解它。第一种:原始定义:假设存在在度量空间Θ上的分布H和一个参数α,如果转载 2013-09-02 18:16:08 · 3226 阅读 · 1 评论 -
topic model 的总结
topic model 是一种应用十分广泛的产生式模型(generative model),在IR, NLP,ML都有广泛的应用,本文将对目前已有的topic model进行分类总结,然后选择几个代表性的topic model进行较为详细的介绍,从而理解topic model 的思想,以及怎么应用。topic model最经典的模型之一是LDA(latent dirichlet a转载 2013-09-02 18:26:06 · 1975 阅读 · 0 评论 -
topic model的分类及设计原则
topic model的介绍性文章已经很多,在此仅做粗略介绍,本文假设读者已经较为熟悉Topic Medel。Topic Model (LDA)认为一个离散数据集合(如文档集合,图片集合,为行文方便,本文统统以文档集合作为描述对象,其他的数据集合只需换掉对应的术语即可)是由隐含在数据集合背后的topic set 生成的,这个set中的每一个topic都是词的概率分布。对于文档中的每一篇文档转载 2013-09-02 18:26:01 · 1052 阅读 · 0 评论 -
dirichlet process 中CRP的马太效应
RT。 CRP中 第n+1个顾客选择第几个桌子的问题,是服从 先把某个table坐满,即人越多的桌子,越容易坐满,人越少的桌子越难坐满。这就是马太效应(Matthew Effect)----两极分化, 就如同创业投资一样,有钱的人越来越容易赚钱,没钱的越来越穷。原创 2013-09-02 17:58:23 · 1090 阅读 · 0 评论 -
Dirichlet distribution的另一种理解,对应的如何解释dirichlet process
建议参考:http://en.wikipedia.org/wiki/Dirichlet_process 翻译:https://docs.google.com/document/d/1Luxn2OqVB-b1VxbB5kRPIGhuT4a_u-cpxCjNy89iBYU/edit来源:http://hi.baidu.com/vyfrcemnsnbgxyd/item/2f10ecc转载 2013-09-03 09:28:28 · 938 阅读 · 0 评论 -
Deduction & Induction
ref:http://www.psych.utah.edu/gordon/Classes/Psy4905Docs/PsychHistory/Cards/Logic.htmlLogical arguments are usually classified as either 'deductive' or 'inductive'.Deduction: In the process of ded转载 2013-09-04 09:48:23 · 2113 阅读 · 0 评论 -
plsa中的d variable
plsa中的d variable,如果p(z|d)服从multinomial,那么d=theta原创 2013-10-03 19:34:22 · 687 阅读 · 0 评论 -
latent variable理解
1. typically, latent variable 存在于mixture model中2. 分为discrete latent variable 和 continuous latent variable3. 相当于indicator,为了便于计算而引入,每个observation data corresponds to a latent variable4. p(x) = si原创 2013-10-02 22:59:37 · 4882 阅读 · 0 评论 -
什么时候用EM算法?topic model case
在topic model中有parameter 和 hyper parameter, 首先我们不要consider hyper parameter,只对parameter与observation 进行model,即log-likelihood 是 ln p(x|theta) = sigma_ln p(x_i|theta) = sigma_ln sigma_i {p(x_i|z_i)原创 2013-10-03 09:27:05 · 1240 阅读 · 0 评论 -
LDA中的variational EM 跟EM
variational EM: http://net.pku.edu.cn/~zhaoxin/vEMLDA.pdfEM: http://www.cnblogs.com/biyeymyhjob/archive/2012/07/21/2603020.html估计方法都是用的MLE, variational EM 估计α\alpha和β\beta(对应EM中的zz),e而实际上也要求的是θ\theta原创 2015-05-20 22:55:52 · 1770 阅读 · 0 评论