LDA学习之beta分布和Dirichlet分布

摘要: ---恢复内容开始---今天学习LDA主题模型,看到Beta分布和Dirichlet分布一脸的茫然,这俩玩意怎么来的,再网上查阅了很多资料,当做读书笔记记下来:先来几个名词: 共轭先验: 在贝叶斯统计理论中,如果某个随机变量Θ的后验概率p(θ|x)和他的先验概率p(θ)属于同一个分布簇的,那么称p(... 阅读全文
posted @ 2015-05-15 23:25 chybot 阅读(747) 评论(0) 推荐(0) 编辑

使用size_t注意边界

摘要: C++中的 size_t 表示数组的下标,一般为:typedef unsigned size_t;在学习中我们一般使用int表示下标,这样在循环中可以判断边界x>=0 或x=0; i--){ ....}但是如果使用size_t则必须加入边界判断,这是由于size_t是无符号数,当它为0时,再... 阅读全文
posted @ 2015-05-08 10:26 chybot 阅读(161) 评论(0) 推荐(0) 编辑

Word Frequency

摘要: Write a bash script to calculate the frequency of each word in a text filewords.txt.For simplicity sake, you may assume:words.txtcontains only lowerca... 阅读全文
posted @ 2015-05-08 08:50 chybot 阅读(257) 评论(0) 推荐(0) 编辑

Tenth Line

摘要: How would you print just the 10th line of a file?For example, assume thatfile.txthas the following content:Line 1Line 2Line 3Line 4Line 5Line 6Line 7L... 阅读全文
posted @ 2015-05-07 21:48 chybot 阅读(198) 评论(0) 推荐(0) 编辑

Valid Phone Numbers

摘要: Given a text filefile.txtthat contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers.You may as... 阅读全文
posted @ 2015-05-07 21:42 chybot 阅读(333) 评论(0) 推荐(0) 编辑

Add Two Numbers

摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2015-05-06 13:50 chybot 阅读(194) 评论(0) 推荐(0) 编辑

Two Sum

摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-05-06 13:45 chybot 阅读(144) 评论(0) 推荐(0) 编辑