IDEAS home Printed from https://ideas.repec.org/p/ecl/stabus/4106.html

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

Author

Listed:
  • Du, Tianyu

    (Stanford U)

  • Kanodia, Ayush

    (Stanford U)

  • Athey, Susan

    (Stanford U)

Abstract

The torch-choice is an open-source library for flexible, fast choice modeling with Python and PyTorch. torch-choice provides a ChoiceDataset data structure to manage databases flexibly and memory-efficiently. The paper demonstrates constructing a ChoiceDataset from databases of various formats and functionalities of 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 torch-choice and 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 torch-choice on large-scale datasets.

Suggested Citation

  • Du, Tianyu & Kanodia, Ayush & Athey, Susan, 2023. "Torch-Choice: A PyTorch Package for Large-Scale Choice Modelling with Python," Research Papers 4106, Stanford University, Graduate School of Business.
  • Handle: RePEc:ecl:stabus:4106
    as

    Download full text from publisher

    File URL: https://arxiv.org/abs/2304.01906
    Download Restriction: no
    ---><---

    Other versions of this item:

    References listed on IDEAS

    as
    1. Rudolph, Maja & Ruiz, Francisco & Athey, Susan & Blei, David, 2017. "Structured Embedding Models for Grouped Data," Research Papers repec:ecl:stabus:3597, Stanford University, Graduate School of Business.
    2. Christopher Conlon & Jeff Gortmaker, 2023. "Incorporating Micro Data into Differentiated Products Demand Estimation with PyBLP," NBER Working Papers 31605, National Bureau of Economic Research, Inc.
    3. Train,Kenneth E., 2009. "Discrete Choice Methods with Simulation," Cambridge Books, Cambridge University Press, number 9780521766555, January.
    4. Robert Donnelly & Francisco J.R. Ruiz & David Blei & Susan Athey, 2021. "Counterfactual inference for consumer choice across many product categories," Quantitative Marketing and Economics (QME), Springer, vol. 19(3), pages 369-407, December.
    5. Bhat, Chandra R., 1995. "A heteroscedastic extreme value model of intercity travel mode choice," Transportation Research Part B: Methodological, Elsevier, vol. 29(6), pages 471-483, December.
    6. Chintagunta, Pradeep & Kyriazidou, Ekaterini & Perktold, Josef, 2001. "Panel data analysis of household brand choices," Journal of Econometrics, Elsevier, vol. 103(1-2), pages 111-153, July.
    7. Steven Berry & James Levinsohn & Ariel Pakes, 2004. "Differentiated Products Demand Systems from a Combination of Micro and Macro Data: The New Car Market," Journal of Political Economy, University of Chicago Press, vol. 112(1), pages 68-105, February.
    8. Susan Athey & David Blei & Robert Donnelly & Francisco Ruiz & Tobias Schmidt, 2018. "Estimating Heterogeneous Consumer Preferences for Restaurants and Travel Time Using Mobile Location Data," AEA Papers and Proceedings, American Economic Association, vol. 108, pages 64-67, May.
    9. Bonoma, Thomas V & Johnston, Wesley J, 1979. "Decision Making under Uncertainty: A Direct Measurement Approach," Journal of Consumer Research, Journal of Consumer Research Inc., vol. 6(2), pages 177-191, Se.
    10. Berry, Steven & Levinsohn, James & Pakes, Ariel, 1995. "Automobile Prices in Market Equilibrium," Econometrica, Econometric Society, vol. 63(4), pages 841-890, July.
    11. Tom Kornstad & Thor Thoresen, 2007. "A discrete choice model for labor supply and childcare," Journal of Population Economics, Springer;European Society for Population Economics, vol. 20(4), pages 781-803, October.
    12. Arthur van Soest, 1995. "Structural Models of Family Labor Supply: A Discrete Choice Approach," Journal of Human Resources, University of Wisconsin Press, vol. 30(1), pages 63-88.
    13. McFadden, Daniel, 1974. "The measurement of urban travel demand," Journal of Public Economics, Elsevier, vol. 3(4), pages 303-328, November.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Guhl, Daniel, 2024. "Tracking time-varying brand equity using household panel data," Journal of Business Research, Elsevier, vol. 182(C).

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Rolf Aaberge & Ugo Colombino, 2014. "Labour Supply Models," Contributions to Economic Analysis, in: Handbook of Microsimulation Modelling, volume 127, pages 167-221, Emerald Group Publishing Limited.
    2. Rolf Aaberge & Ugo Colombino, 2018. "Structural Labour Supply Models and Microsimulation," International Journal of Microsimulation, International Microsimulation Association, vol. 11(1), pages 162-197.
    3. Griffith, Rachel & O'Connell, Martin & Miller, Helen, 2011. "Corporate taxes and the location of intellectual property," CEPR Discussion Papers 8424, C.E.P.R. Discussion Papers.
    4. Robert Donnelly & Francisco J. R. Ruiz & David Blei & Susan Athey, 2021. "Correction to: Counterfactual inference for consumer choice across many product categories," Quantitative Marketing and Economics (QME), Springer, vol. 19(3), pages 409-409, December.
    5. Pierre Dubois & Rachel Griffith & Martin O'Connell, 2020. "How Well Targeted Are Soda Taxes?," American Economic Review, American Economic Association, vol. 110(11), pages 3661-3704, November.
    6. Rachel Griffith & Lars Nesheim & Martin O'Connell, 2018. "Income effects and the welfare consequences of tax in differentiated product oligopoly," Quantitative Economics, Econometric Society, vol. 9(1), pages 305-341, March.
    7. Jan De Loecker & Paul T. Scott, 2016. "Estimating market power Evidence from the US Brewing Industry," NBER Working Papers 22957, National Bureau of Economic Research, Inc.
    8. Takahiko Kiso, 2019. "Evaluating New Policy Instruments of the Corporate Average Fuel Economy Standards: Footprint, Credit Transferring, and Credit Trading," Environmental & Resource Economics, Springer;European Association of Environmental and Resource Economists, vol. 72(2), pages 445-476, February.
    9. Susan Athey & Guido W. Imbens, 2007. "Discrete Choice Models With Multiple Unobserved Choice Characteristics," International Economic Review, Department of Economics, University of Pennsylvania and Osaka University Institute of Social and Economic Research Association, vol. 48(4), pages 1159-1192, November.
    10. John K. Dagsvik & Zhiyang Jia, 2014. "Labor supply as a discrete choice among latent jobs: Unobserved heterogeneity and identification," Discussion Papers 786, Statistics Norway, Research Department.
    11. Nicholas-James Clavet & Luca Tiberti & Marko Vladisavljevic & Jelena Zarkovic Rakic & Aleksandra Anic & Gorana Krstic & Sasa Randelovic, 2017. "Reduction of child poverty in Serbia: Improved cash-transfers or higher work incentives for parents?," Working Papers PMMA 2017-04, PEP-PMMA.
    12. Patrick Bigler & Doina Maria Radulescu, 2022. "Environmental, Redistributive and Revenue Effects of Policies Promoting Fuel Efficient and Electric Vehicles," CESifo Working Paper Series 9645, CESifo.
    13. Martin, Elliott William, 2009. "New Vehicle Choice, Fuel Economy and Vehicle Incentives: An Analysis of Hybrid Tax Credits and the Gasoline Tax," University of California Transportation Center, Working Papers qt5gd206wv, University of California Transportation Center.
    14. Martin, Elliot William, 2009. "New Vehicle Choices, Fuel Economy and Vehicle Incentives: An Analysis of Hybrid Tax Credits and Gasoline Tax," University of California Transportation Center, Working Papers qt6sz198c2, University of California Transportation Center.
    15. Nicholas Economides & Katja Seim & V. Brian Viard, 2008. "Quantifying the benefits of entry into local phone service," RAND Journal of Economics, RAND Corporation, vol. 39(3), pages 699-730, September.
    16. John Creedy & Guyonne Kalb, 2005. "Discrete Hours Labour Supply Modelling: Specification, Estimation and Simulation," Journal of Economic Surveys, Wiley Blackwell, vol. 19(5), pages 697-734, December.
    17. Paul Scott, 2017. "Estimating Market Power: Evidence from the US Brewing Industry," 2017 Meeting Papers 389, Society for Economic Dynamics.
    18. Martin S. Gaynor & Samuel A. Kleiner & William B. Vogt, 2013. "A Structural Approach to Market Definition With an Application to the Hospital Industry," Journal of Industrial Economics, Wiley Blackwell, vol. 61(2), pages 243-289, June.
    19. Syed Badruddoza & Modhurima Amin & Jill McCluskey, 2019. "Assessing the Importance of an Attribute in a Demand SystemStructural Model versus Machine Learning," Working Papers 2019-5, School of Economic Sciences, Washington State University.
    20. Adithya Pattabhiramaiah & S. Sriram & Shrihari Sridhar, 2018. "Rising Prices Under Declining Preferences: The Case of the U.S. Print Newspaper Industry," Marketing Science, INFORMS, vol. 37(1), pages 97-122, January.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:ecl:stabus:4106. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: the person in charge (email available below). General contact details of provider: https://edirc.repec.org/data/gsstaus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.