Statistical Model Computation with UDFs
Author:
- 18 March 2010
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Knowledge and Data Engineering
- Vol. 22 (12) , 1752-1765
Abstract
Statistical models are generally computed outside a DBMS due to their mathematical complexity. We introduce techniques to efficiently compute fundamental statistical models inside a DBMS exploiting User-Defined Functions (UDFs). Specifically, we study the computation of linear regression, PCA, clustering, and Naive Bayes. Two summary matrices on the data set are mathematically shown to be essential for all models: the linear sum of points and the quadratic sum of cross products of points. We consider two layouts for the input data set: horizontal and vertical. We first introduce efficient SQL queries to compute summary matrices and score the data set. Based on the SQL framework, we introduce UDFs that work in a single table scan: aggregate UDFs to compute summary matrices for all models and a set of primitive scalar UDFs to score data sets. Experiments compare UDFs and SQL queries (running inside the DBMS) with C++ (analyzing exported files). In general, UDFs are faster than SQL queries and not much slower than C++. Considering export times, C++ is slower than UDFs and SQL queries. Statistical models based on precomputed summary matrices are computed in a few seconds. UDFs scale linearly and only require one table scan, highlighting their efficiency.Keywords
This publication has 21 references indexed in Scilit:
- PLANETProceedings of the VLDB Endowment, 2009
- Building statistical models and scoring with UDFs2007
- Data mining for business applicationsACM SIGKDD Explorations Newsletter, 2006
- An out-of-core sparse symmetric-indefinite factorization methodACM Transactions on Mathematical Software, 2006
- MauveDB2006
- Self-tuning cost modeling of user-defined functions in an object-relational DBMSACM Transactions on Database Systems, 2005
- A native extension of SQL for mining data streams2005
- Efficient disk-based K-means clustering for relational databasesIEEE Transactions on Knowledge and Data Engineering, 2004
- Pushing support constraints into association rules miningIEEE Transactions on Knowledge and Data Engineering, 2003
- BIRCHACM SIGMOD Record, 1996