Machine Learning Ex 5.1 - Regularized Linear Regression
The first part of the Exercise 5.1 requires to implement a regularized version of linear regression. Adding regularization parameter can prevent the problem of over-fitting when fitting a high-order...
View ArticleMachine Learning Ex 5.2 - Regularized Logistic Regression
Now we move on to the second part of the Exercise 5.2, which requires to implement regularized logistic regression using Newton's Method. Plot the data: x <- read.csv("ex5Logx.dat", header=F) y...
View Articleproject euler-Problem1-50
06年开始学perl,因为要用bioperl,08年开始用R,因为想要用bioconductor的包。刚学R的时候,一片混乱啊,矢量计算啥的,一开始很不习惯。 那时候知道Project Euler,通过用R写代码来解决这些数学问题,开始对R熟悉起来。这对我学习R和编程是很有帮助的。...
View Articlemigrate from tetex to texlive
在CentOS升级R到2.14之后,编译vignettes时便报错了,原因是少了latex的inconsolata.sty,这是文档中代码要需要用到的字体。google不出解决方案,基本上都是说不关R的事,要装latex包。 CentOS的repos里没有这个包,latex的东西以前折腾过,搞起来太麻烦。 现在一般用整合的latex环境,比如MiKTeX和TeX...
View Article如何教生物学生使用R编程
最近两三年,明显感觉关于R的书籍多了起来,年初更是进入了TOBIE排行版的前20,Oracle 又准备将R整合到其数据库产品中。和Hadoop集群的整合,必然会使R在大数据分析和可视化领域中火起来的。 Bioconductor上有大量的分析包,是生物界所无法回避的,Ewan Birney在其博文Five statistical things I wished I had been taught 20...
View Articlehey mac
初中时在杂志上看到苹果的彩壳机,从此叔就开始成为了苹果的脑残粉,还在K6-2和win98那会,就在玩macintosh主题。 本科时,通过PearPC来虚拟PowerPC,硬是在ATHLON XP 1700+这个破CPU上破了OS X Jaguar,那个慢啊,是无法忍受的。 后来,有了一台powerbook,却拿它来装gentoo和netbsd。从那里候开始,基本上就只用Linux/BSD。...
View ArticleR & C++ integration
这题目太标题党了,最近啃了半部《C++ Primer Plus》,除了书中习题,就没其它写过C++程序,下午读了Rcpp的文档,把mlass包里kMeans算法的核心部分用c++重新写了。 C++果然给力,速度提高不是一点两点。 > require(mlass) > data(iris) > x=iris[,-5] > res = benchmark(kMeans(x, 3,...
View Articletricky things in R
______________ < R is awesome > -------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || 赋值...
View Articleproject euler -- problem 54
In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way: High Card: Highest value card. One Pair: Two cards of the same value. Two Pairs: Two...
View Articlelatex for wordpress
最初用的是wp-latex,支持$latex latex_syntax $一直就这么用了。 因为这个插件是生成图片,这种方式显然不太好。发现MathJax之后,果断换成MathJax,最近发现空间快被占满了,而这个MathJax用掉了100多M,所以找个插件,可以用在线的MathJax服务器的,这样就可以把空间上的MathJax库删了。 latex for...
View Articlemodified wp-codebox to highlight R code as in Pretty-R
I found wp-codebox could highlight R code two years ago. This plugin is based on GeSHi to highlight source code internally. Now there are many ways to highlight R syntax in the website. Pretty-R...
View Articleproject euler -- problem 69
Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n. For example, as 1, 2, 4, 5, 7, and 8, are...
View Articleproject euler -- problem 70
Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to n which are relatively prime to n. For example, as 1, 2, 4,...
View ArticleComplementing a Strand of DNA
In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'. The reverse complement of a DNA string s is the string sc formed by reversing the symbols of s, then taking the...
View ArticleRabbits and Recurrence Relations
Problem A sequence is an ordered collection of objects (usually numbers), which are allowed to repeat. Sequences can be finite or infinite. Two examples are the finite sequence (Π,−√2,0,Π) and the...
View Article使用ImageMagick压缩TIFF
TIFF (Tagged Image File Format)拥有更宽的线性动态范围,所以在专业的图片处理上,一直是一个通用的文件格式。 最近一篇发表在Metallomics的文章,我本来做的图片都是PDF格式,矢量图最好了,文件特别小,还可以任意放大。不过杂志社要求600DPI的TIFF或EPS。...
View ArticleConsensus and Profile
Problem A matrix is a rectangular table of values divided into rows and columns. An m×n matrix has m rows and n columns. Given a matrix A, we write Ai,j to indicate the value found at the intersection...
View ArticleInstall Emacs on Mac
package manager 之前一直用NetBSD的pkgsrc做为各种Unix-like系统的包管理系统,pkgsrc在自己内部解决依赖关系,这点对于生产环境来说,是很好的一个优点,我通常会在服务器里装一个pkgsrc,在用户目录下,维护一套UNIX软件。但是用在自己的机器上,内部解决软件依赖,就是个缺点,浪费编译时间和硬盘空间。...
View ArticleRun remote R in Emacs with ESS
Emacs is a great front-end for most of the command line tools. Although R-Studio is pretty good, I think Emacs/ESS is better. I’ve always used Emacs/ESS to run R, since 2007 on Ubuntu, on Windows, and...
View Articlelocal blast
I was asked to set up a local blast for the lab. Blast can be installed directly using apt in debian and it turns out to be easy. ?View Code BASH1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16...
View Article