Blog Archives

By-Group Aggregation in Parallel

October 4, 2014
By
By-Group Aggregation in Parallel

Similar to the row search, by-group aggregation is another perfect use case to demonstrate the power of split-and-conquer with parallelism. In the example below, it is shown that the homebrew by-group aggregation with foreach pakage, albeit inefficiently coded, is still a lot faster than the summarize() function in Hmisc package.

Read more »

Vector Search vs. Binary Search

October 1, 2014
By
Vector Search vs. Binary Search

Read more »

Row Search in Parallel

September 28, 2014
By
Row Search in Parallel

I’ve been always wondering whether the efficiency of row search can be improved if the whole data.frame is splitted into chunks and then the row search is conducted within each chunk in parallel. In the R code below, a comparison is done between the standard row search and the parallel row search with the FOREACH

Read more »

Chain Operations: An Interesting Feature in dplyr Package

July 28, 2014
By
Chain Operations: An Interesting Feature in dplyr Package

Read more »

Efficiency of Importing Large CSV Files in R

February 10, 2014
By
Efficiency of Importing Large CSV Files in R

Read more »

Julia and SQLite

February 8, 2014
By
Julia and SQLite

Similar to R and Pandas in Python, Julia provides a simple yet efficient interface with SQLite database. In addition, it is extremely handy to use sqldf() function, which is almost identical to the sqldf package in R, in SQLite package for data munging.

Read more »

Simplex Model in R

February 2, 2014
By
Simplex Model in R

R CODE R OUTPUT SAS CODE & OUTPUT FOR COMPARISON

Read more »

rPython – R Interface to Python

October 13, 2013
By
rPython – R Interface to Python

Read more »

Generate and Retrieve Many Objects with Sequential Names

September 8, 2013
By
Generate and Retrieve Many Objects with Sequential Names

While coding ensemble methods in data mining with R, e.g. bagging, we often need to generate many data and models objects with sequential names. Below is a quick example how to use assign() function to generate many prediction objects on the fly and then retrieve these predictions with mget() to do the model averaging.

Read more »

Prototyping Multinomial Logit with R

August 21, 2013
By
Prototyping Multinomial Logit with R

Recently, I am working on a new modeling proposal based on the competing risk and need to prototype multinomial logit models with R. There are R packages implementing multinomial logit models that I’ve tested, namely nnet and vgam. Model outputs with iris data are shown below. However, in my view, above methods are not flexible

Read more »