arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.00422cs.DBcs.LG
收藏

JoinBoost:仅使用SQL在规范化数据上构建树模型

JoinBoost: Grow Trees Over Normalized Data Using Only SQL

Columbia University(哥伦比亚大学);Microsoft(微软);DSI, Columbia University(哥伦比亚大学数据科学研究所)

Zezhou Huang, Rathijit Sen, Jiaxiang Liu, Eugene Wu

AI总结:

提出JoinBoost库,将树训练算法重写为纯SQL,通过支持因子化梯度提升和优化残差更新,在无需修改DBMS的前提下实现高效可扩展的库内机器学习。

摘要:

尽管在处理表格数据时占据主导地位,但在规范化数据库上训练树模型的机器学习库(如LightGBM、XGBoost)要求数据被反规范化为单表、物化并导出。这一过程缺乏可扩展性、速度缓慢,且存在安全风险。库内机器学习(In-DB ML)旨在数据库管理系统(DBMS)内部训练模型,以避免数据移动并提供数据治理。与其修改DBMS以支持In-DB ML,是否可能仅使用SQL就提供与专用机器学习库相媲美的树训练性能?我们提出了JoinBoost,这是一个Python库,可将规范化数据库上的树训练算法重写为纯SQL。它可移植到任何DBMS,提供与专用机器学习库相竞争的性能,并随底层DBMS的能力进行扩展。JoinBoost从算法和系统两个方面扩展了先前的工作。在算法上,我们通过在非物化的连接结果中将$Y$变量更新为残差,来支持因子化梯度提升。尽管这个视图更新问题通常是模糊的,但我们发现了加法到乘法的保持性,这是方差半环支持均方根误差(rmse,最广泛使用的标准)的关键属性。在系统上,我们将残差更新识别为性能瓶颈。这种开销可以通过创建一个新的残差值列并将其添加为投影,在列式DBMS上得到原生最小化。我们通过在DuckDB上的两种实现验证了这一点,为了可移植性,对其内部没有或仅有最少的修改。我们的实验表明,与LightGBM相比,JoinBoost在随机森林(梯度提升)上快了3倍(1.1倍),并且比最先进的In-DB ML系统快一个数量级以上。此外,在特征数量、数据库大小(TPC-DS SF=1000)和连接图复杂度(星系模式)方面,JoinBoost的扩展性远超LightGBM。

英文摘要:

Although dominant for tabular data, ML libraries that train tree models over normalized databases (e.g., LightGBM, XGBoost) require the data to be denormalized as a single table, materialized, and exported. This process is not scalable, slow, and poses security risks. In-DB ML aims to train models within DBMSes to avoid data movement and provide data governance. Rather than modify a DBMS to support In-DB ML, is it possible to offer competitive tree training performance to specialized ML libraries...with only SQL? We present JoinBoost, a Python library that rewrites tree training algorithms over normalized databases into pure SQL. It is portable to any DBMS, offers performance competitive with specialized ML libraries, and scales with the underlying DBMS capabilities. JoinBoost extends prior work from both algorithmic and systems perspectives. Algorithmically, we support factorized gradient boosting, by updating the $Y$ variable to the residual in the non-materialized join result. Although this view update problem is generally ambiguous, we identify addition-to-multiplication preserving, the key property of variance semi-ring to support rmse, the most widely used criterion. System-wise, we identify residual updates as a performance bottleneck. Such overhead can be natively minimized on columnar DBMSes by creating a new column of residual values and adding it as a projection. We validate this with two implementations on DuckDB, with no or minimal modifications to its internals for portability. Our experiment shows that JoinBoost is 3x (1.1x) faster for random forests (gradient boosting) compared to LightGBM, and over an order magnitude faster than state-of-the-art In-DB ML systems. Further, JoinBoost scales well beyond LightGBM in terms of the # features, DB size (TPC-DS SF=1000), and join graph complexity (galaxy schemas).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑