arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.01906cs.LGcs.MSecon.EM
收藏

Torch-Choice:一个基于Python和PyTorch的大规模选择建模软件包

Torch-Choice: A PyTorch Package for Large-Scale Choice Modeling with Python

Stanford University(斯坦福大学)

Tianyu Du, Ayush Kanodia, Susan Athey

AI总结:

本文介绍基于PyTorch的开源选择建模库torch-choice,其通过ChoiceDataset高效管理数据、支持多项与嵌套Logit模型及GPU加速,并在大规模数据上展现出优于R中mlogit的计算效率和可扩展性。

摘要:

torch-choice 是一个开源库,用于使用 Python 和 PyTorch 进行灵活、快速的选择建模。torch-choice 提供了 ChoiceDataset 数据结构,以灵活且内存高效的方式管理数据库。本文演示了从各种格式的数据库构建 ChoiceDataset 以及 ChoiceDataset 的功能。该软件包实现了两种广泛使用的模型,即多项 Logit 模型和嵌套 Logit 模型,并支持模型估计过程中的正则化。该软件包还提供了利用 GPU 进行估计的选项,使其能够扩展到大规模数据集,同时保持计算效率。模型可以使用 R 风格的公式字符串或 Python 字典进行初始化。最后,我们比较了 torch-choice 与 R 中 mlogit 的计算效率,比较维度包括:(1)观测数量增加,(2)协变量数量增加,以及(3)项目集合的扩展。最后,我们展示了 torch-choice 在大规模数据集上的可扩展性。

英文摘要:

The $\texttt{torch-choice}$ is an open-source library for flexible, fast choice modeling with Python and PyTorch. $\texttt{torch-choice}$ provides a $\texttt{ChoiceDataset}$ data structure to manage databases flexibly and memory-efficiently. The paper demonstrates constructing a $\texttt{ChoiceDataset}$ from databases of various formats and functionalities of $\texttt{ChoiceDataset}$. The package implements two widely used models, namely the multinomial logit and nested logit models, and supports regularization during model estimation. The package incorporates the option to take advantage of GPUs for estimation, allowing it to scale to massive datasets while being computationally efficient. Models can be initialized using either R-style formula strings or Python dictionaries. We conclude with a comparison of the computational efficiencies of $\texttt{torch-choice}$ and $\texttt{mlogit}$ in R as (1) the number of observations increases, (2) the number of covariates increases, and (3) the expansion of item sets. Finally, we demonstrate the scalability of $\texttt{torch-choice}$ on large-scale datasets.

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

↑