Archives
Categories
Author Archives: earl
Labeled boxplot in R
As generated by R’s boxplot function. I individually labeled the median, quartiles, min, max, and outliers for inclusion in a presentation where the audience can’t be assumed to know how to interpret box plots. Please feel free to use this … Continue reading
Posted in R, Statistics, Visualization
Leave a comment
Calculating the hessian of the logistic log likelihood
I may be the only person who feels this way, but it’s awfully easy to read a paper or a book, see some equations, think about them a bit, then sort of nod your head and think you understand them. … Continue reading
Posted in Classifiers
Leave a comment
Saving both stdout and stderr while echoing to screen
As mentioned before, tee, a useful but horridly named utility, allows you to save stdout while echoing it to the screen. Sometimes, however, you need both stderr and stdout. Bash allows you to combine stderr and stdout by appending 2>&1 … Continue reading
Advantage made my cat have seizures
For all of the web searchers, apparently Advantage can make cats have seizures. Six months ago Lucy the cat got fleas, most likely from the vet where she’d been for some minor surgery. We applied canine advantage to our dog … Continue reading
Posted in Cat Blogging
1 Comment
Bash tricks: drop the first line of a file
I work with a bunch of data that often comes in text files. I regularly want to cut off the header / first line, but I thought that to use tail you had to know how many lines are in … Continue reading
Posted in bash, Data Munging
1 Comment
Amazon price jumps
Does anyone else regularly see large price swings on Amazon? I’m in the habit of adding books to my shopping cart until I run out of things to read at home, then buying whatever is in my cart at the … Continue reading
Posted in Uncategorized
Leave a comment
Saving output of a command and echoing to the screen
When using bash, it’s really nice to both save the output of a command to a file and print it on the screen. I couldn’t find something that did this so I wrote my own ruby script. A utility that … Continue reading
Posted in bash, Data Munging
Leave a comment
Online display advertising ecosystem
The biggest divide in the online advertising world is search advertising vs display advertising, and search sounds exactly like what it is — search is generally the ads next to searches on Google, Yahoo, Bing, etc. Search is bigger than … Continue reading
Unique is broken in R
Are you kidding me? $ R > unique(1,1,2,3,4) [1] 1 This was the source of yesterday’s nasty to track down bug. What you really want is unique on a vector, as in: > unique(c(1,1,2,3,4)) [1] 1 2 3 4 I … Continue reading
Posted in Programming, Programming Languages Suck, R, R Tip, Suck
Leave a comment
Formatted numbers in Ruby
In C or C++, it’s can be a pain to get thousands separators in printf. In ruby, it can be trivial, as long as you use the right libraries. If you have ActiveSupport installed (which I believe comes with Rails), … Continue reading
Posted in Programming, Programming Languages Suck, Ruby
Leave a comment