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

使用Python中的SQL代码生成进行高效准确的数据库内机器学习

Efficient and Accurate In-Database Machine Learning with SQL Code Generation in Python

Hochschule Luzern(卢塞恩应用科学与艺术大学)

Michael Kaufmann, Gabriel Stechschulte, Anna Huber

摘要:

分析了基于SQL的机器学习(ML)的优点,并对该领域进行了简短的文献综述,提出了一种新的数据库内机器学习(IDBML)方法。我们贡献了一个在Python中使用Jinja 2中的模板宏生成SQL-代码生成的过程以及该过程的原型实现。我们描述了我们在SQL中计算多维直方图(MDH)概率估计的过程的实现。为此,我们贡献并实现了一种新的离散化方法,称为等量化秩分仓(EQRB)和等宽分仓(EWB)。在此基础上,我们提供了在基准测试实验中收集的数据,用于使用Covertype数据集对我们的方法和系统进行定量实证评估。我们测量了准确性和计算时间,并将其与Scikit Learn最先进的分类算法进行了比较。使用EWB,我们的多维概率估计是所有测试算法中最快的,而准确度仅比最先进的方法(决策树和随机森林)低1-2%。我们的方法比朴素贝叶斯更准确,朴素贝叶斯假设独立的一维概率和/或密度。此外,我们的方法比逻辑回归更准确,更快。这激发了对准确性改进和针对大数据和大于内存的数据集的具有SQL代码生成的IDBML的进一步研究。

英文摘要:

Following an analysis of the advantages of SQL-based Machine Learning (ML) and a short literature survey of the field, we describe a novel method for In-Database Machine Learning (IDBML). We contribute a process for SQL-code generation in Python using template macros in Jinja2 as well as the prototype implementation of the process. We describe our implementation of the process to compute multidimensional histogram (MDH) probability estimation in SQL. For this, we contribute and implement a novel discretization method called equal quantized rank binning (EQRB) and equal-width binning (EWB). Based on this, we provide data gathered in a benchmarking experiment for the quantitative empirical evaluation of our method and system using the Covertype dataset. We measured accuracy and computation time and compared it to Scikit Learn state of the art classification algorithms. Using EWB, our multidimensional probability estimation was the fastest of all tested algorithms, while being only 1-2% less accurate than the best state of the art methods found (decision trees and random forests). Our method was significantly more accurate than Naive Bayes, which assumes independent one-dimensional probabilities and/or densities. Also, our method was significantly more accurate and faster than logistic regression. This motivates for further research in accuracy improvement and in IDBML with SQL code generation for big data and larger-than-memory datasets.

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

↑