This guest post is by Douglas McNair MD PhD, Engineering Fellow & President, Cerner Math Inc. -- ed.
RevoScaleR scaling big-data modeling performance for real-time health data analysis at Cerner
The size of data sets is increasing much more rapidly than the speed of cores, of RAM, and of disk drives. This is particularly true of electronic health records (EHRs) and other health care data, where multi-billion-row relational tables with dozens to thousands of columns are common in data warehouses derived from EHRs. Analyzing a data set that contains N observations on P variables frequently entails operating on several terabyte arrays — too large for main memory, beyond the statistical packages’ typical limit of a maximum vector length of 231 – 1 (around two billion cells), and too large even for pagefile virtual memory on a single machine.
Statistical software able to use multi-core processors is a necessary, but not sufficient requirement to deal with data of this size. For statistical analysis of large data, you also need:
- parallelized external memory algorithms (PEMAs) that do not require all data to be in RAM, and
- efficient multi-threading and inter-process communication across massively parallel clusters of computers.
Like other statistical packages, the R system is memory-limited. Revolution Analytics' RevoScaleR and bigmemory and a few other big-data packages overcome the memory limitation of R by providing a backing file for processing blocks of data at a time or by providing an ODBC or other streaming service for processing blocks of data.
Since cardinality N is large, especially for our pharmacovigilance (drug safety) and other use-cases that involve modeling low-eventrate low-prevalence outcomes, only tasks with complexity that is approximately O(N) are feasible. But not all big-memory and parallelized architectures offer comparable performance or scalability.
For example, Lumley’s biganalytics package in R provides a method for passing big.matrix objects to the biglm function, which computes ordinary least squares regressions on large datasets, like one of Cerner’s cohorts of Type 2 diabetics:
library(biglm)
library(foreach)
biglm.big.matrix( los.outlier
~ gender + age.grp + medicaid + last.HbA1c +
max.creat + min.glu + nbr.adm24mo + nbr.comorbid_dx +
nosocomial.inf,
family=binomial(), data="type2_diabetic" )
And Revolution R Enterprise can do the same with RevoScaleR:
rxLogit( los.outlier ~ gender
+ age.grp + medicaid + last.HbA1c +
max.creat + min.glu + nbr.adm24mo + nbr.comorbid_dx + nosocomial.inf,
data="type2_diabetic.xdf" )
Happily, the biglm regression takes less than 20 seconds to run on this cohort of 2 million diabetic patients and 10 variables. But even more remarkably, the rxLogit regression takes less than 0.5 seconds to run on this dataset. (Both analyses ran on a Windows 7, 64-bit quadcore 2.5 GHz laptop with 8 MB of RAM.) And the RevoScaleR regression runs far faster than this on a multi-node cluster.
The difference might seem inconsequential if our use-case involved a one-time execution of a regression at model-development-time. However, a majority of our run-time applications instead involve near-realtime kmeans ‘clustering’ or ‘classification’ or ‘prediction’ use-cases with high cardinality and dimensionality, where close matches to a particular patient and her attributes are sought within very large cohorts, and this task is repeated for successive different patients every second.
For high-value, high-performance applications like these, RevoScaleR and related tools are fast becoming an indispensable part of Cerner’s armamentarium for addressing many use-cases in health services and population health management.
Douglas McNair, MD, PhD, is president of Cerner Math, Inc., and one of three Cerner Engineering Fellows and is responsible for innovations in decision support and very-large-scale datamining. McNair joined Cerner in 1986, first as VP of Cerner’s Knowledge Systems engineering department; then as VP of Regulatory Affairs; then as General Manager for Cerner’s Detroit and Kansas City branches. Subsequently, he was Chief Research Officer, responsible for Cerner’s clinical research operations. In 1987, McNair was co-inventor and co-developer of Discern Expert®, a decision-support engine that today is used in more than 2,000 health care facilities around the world. Between 1977 and 1986, McNair was a faculty member of Baylor College of Medicine in the Departments of Medicine and Pathology. He is a diplomate of the American Board of Pathology and the American Board of Internal Medicine.
biglm.big.matrix is not a biglm library. So, you should call 'library(biganalytics)' instead of 'library(biglm)'.
Posted by: wdkz | September 10, 2012 at 18:08
This is very fascinating type of research. I am supremely surprised to see the integration of computer science with medical science. Are you using sample management software to log in your results? I am amazed of how far this type of field has developed. I guess we can still use Moore's Law to see how well our microchips will perform in the future and compare it to our own performance. Thank you for informing me on this subject.
Posted by: Giana Forzareli | September 17, 2012 at 08:47
Hi
How can I use RevoScaleR (or bigmemory, ff, RHadoop...) but not only with its internally defined commands but with another package?
For example how can I use zoo to aggregate to large series using Revoscaler to read the files (and stream it)?
Regards
Posted by: skan | March 27, 2013 at 14:04
Hello Skan,
The RevoScaleR package is only available with Revolution R Enterprise. There is a white paper (http://www.revolutionanalytics.com/why-revolution-r/whitepapers/Data-Step-White-Paper.pdf) that describes how to aggregate data with RevoScaleR functions to build time series that may be processed with zoo.
There is also a very nice ff tutorial by Jan Wijffels on R-Bloggers from last August (http://www.r-bloggers.com/if-you-are-into-large-data-and-work-a-lot-with-package-ff/) that may be helpful.
If you can formulate a specific question your best bet for help might be the r-help mailing list.
Best regards,
Posted by: Joseph Rickert | March 27, 2013 at 16:14
Hi. I know that Revoscaler is available with Revolution R. Buth there are many other packages and I don't know which one to investigate.
I'll have a look to that paper.
But then, can you use ff, Revoscaler to feed other packages or you have to export small pieces of data and work with them?
Posted by: skan | March 28, 2013 at 05:02