Characterization and automatic updates of deprecated machine-learning API usages

Due to the rise of AI applications, machine learning (ML) libraries, often written in Python, have become far more accessible. ML libraries tend to be updated periodically, which may deprecate existing APIs, making it necessary for application developers to update their usages. In this paper, we bui...

Full description

Saved in:
Bibliographic Details
Main Authors: AGUS HARYONO, Stefanus, Ferdian, Thung, LO, David, LAWALL, Julia, JIANG, Lingxiao
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2021
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/6649
https://ink.library.smu.edu.sg/context/sis_research/article/7652/viewcontent/icsme21MLCatchUpTool.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-7652
record_format dspace
spelling sg-smu-ink.sis_research-76522022-01-14T03:20:03Z Characterization and automatic updates of deprecated machine-learning API usages AGUS HARYONO, Stefanus Ferdian, Thung LO, David LAWALL, Julia JIANG, Lingxiao Due to the rise of AI applications, machine learning (ML) libraries, often written in Python, have become far more accessible. ML libraries tend to be updated periodically, which may deprecate existing APIs, making it necessary for application developers to update their usages. In this paper, we build a tool to automate deprecated API usage updates. We first present an empirical study to better understand how updates of deprecated ML API usages in Python can be done. The study involves a dataset of 112 deprecated APIs from Scikit-Learn, TensorFlow, and PyTorch. Guided by the findings of our empirical study, we propose MLCatchUp, a tool to automate the updates of Python deprecated API usages, that automatically infers the API migration transformation through comparison of the deprecated and updated API signatures. These transformations are expressed in a Domain Specific Language (DSL). We evaluate MLCatchUp using a dataset containing 267 files with 551 API usages that we collected from public GitHub repositories. In our dataset, MLCatchUp can detect deprecated API usages with perfect accuracy, and update them correctly for 80.6% of the cases. We further improve the accuracy of MLCatchUp in performing updates by adding a feature that allows it to accept an additional user input that specifies the transformation constraints in the DSL for context-dependent API migration. Using this addition, MLCatchUp can make correct updates for 90.7% of the cases 2021-09-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/6649 info:doi/10.1109/ICSME52107.2021.00019 https://ink.library.smu.edu.sg/context/sis_research/article/7652/viewcontent/icsme21MLCatchUpTool.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Python Program Transformation Automatic Update Deprecated API Artificial Intelligence and Robotics Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Python
Program Transformation
Automatic Update
Deprecated API
Artificial Intelligence and Robotics
Software Engineering
spellingShingle Python
Program Transformation
Automatic Update
Deprecated API
Artificial Intelligence and Robotics
Software Engineering
AGUS HARYONO, Stefanus
Ferdian, Thung
LO, David
LAWALL, Julia
JIANG, Lingxiao
Characterization and automatic updates of deprecated machine-learning API usages
description Due to the rise of AI applications, machine learning (ML) libraries, often written in Python, have become far more accessible. ML libraries tend to be updated periodically, which may deprecate existing APIs, making it necessary for application developers to update their usages. In this paper, we build a tool to automate deprecated API usage updates. We first present an empirical study to better understand how updates of deprecated ML API usages in Python can be done. The study involves a dataset of 112 deprecated APIs from Scikit-Learn, TensorFlow, and PyTorch. Guided by the findings of our empirical study, we propose MLCatchUp, a tool to automate the updates of Python deprecated API usages, that automatically infers the API migration transformation through comparison of the deprecated and updated API signatures. These transformations are expressed in a Domain Specific Language (DSL). We evaluate MLCatchUp using a dataset containing 267 files with 551 API usages that we collected from public GitHub repositories. In our dataset, MLCatchUp can detect deprecated API usages with perfect accuracy, and update them correctly for 80.6% of the cases. We further improve the accuracy of MLCatchUp in performing updates by adding a feature that allows it to accept an additional user input that specifies the transformation constraints in the DSL for context-dependent API migration. Using this addition, MLCatchUp can make correct updates for 90.7% of the cases
format text
author AGUS HARYONO, Stefanus
Ferdian, Thung
LO, David
LAWALL, Julia
JIANG, Lingxiao
author_facet AGUS HARYONO, Stefanus
Ferdian, Thung
LO, David
LAWALL, Julia
JIANG, Lingxiao
author_sort AGUS HARYONO, Stefanus
title Characterization and automatic updates of deprecated machine-learning API usages
title_short Characterization and automatic updates of deprecated machine-learning API usages
title_full Characterization and automatic updates of deprecated machine-learning API usages
title_fullStr Characterization and automatic updates of deprecated machine-learning API usages
title_full_unstemmed Characterization and automatic updates of deprecated machine-learning API usages
title_sort characterization and automatic updates of deprecated machine-learning api usages
publisher Institutional Knowledge at Singapore Management University
publishDate 2021
url https://ink.library.smu.edu.sg/sis_research/6649
https://ink.library.smu.edu.sg/context/sis_research/article/7652/viewcontent/icsme21MLCatchUpTool.pdf
_version_ 1770576016859725824