[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-118235-en":3,"doc-seo-118235-105":30,"detail-sidebar-cat-0-en-105":92},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},118235,1099514068035,"Ezra","https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c",8,"Research & Report","Detecting Refactoring Commits in Machine Learning Python Projects - A Machine Learning-Based Approach","Refactoring improves software quality without changing functional behavior, yet developers’ refactoring practices are hard to study because maintenance documentation is often incomplete or vague. In machine learning (ML) Python ecosystems, refactoring follows a data-driven development process and includes ML-specific refactoring types that existing rule-based detectors for Python cannot reliably find. MLRefScanner, a machine-learning prototype, detects refactoring-related commits in ML Python libraries beyond state-of-the-art coverage, evaluated on 199 open-source projects and validated against Python refactoring tools.","arXiv :2404 .06572v 1 [ cs . SE] 9 Apr 2024  \nDetecting Refactoring Commits in Machine Learning Python Projects: A Machine Learning-Based Approach  \nSHAYAN NOEI, Queen’s University, Canada HENG LI, Polytechnique Montréal, Canada YING ZOU, Queen’s University, Canada  \nRefactoring aims to improve the quality of software without altering its functional behaviors. Understanding developers’ refactoring activities is essential to improve software maintainability. The use of machine learning (ML) libraries and frameworks in software systems has significantly increased in recent years, making the maximization of their maintainability crucial. Due to the data-driven nature of ML libraries and frameworks, they often undergo a different development process compared to traditional projects. As a result, they may experience various types of refactoring, such as those related to the data. The state-of-the-art refactoring detection tools have not been tested in the ML technical domain, and they are not specifically designed to detect ML-specific refactoring types (e.g., data manipulation) in ML projects; therefore, they may not adequately find all potential refactoring operations, specifically the ML-specific refactoring operations. Furthermore, a vast number of ML libraries and frameworks are written in Python, which has limited tooling support for refactoring detection. PyRef, a rule-based and state-of-the-art tool for Python refactoring detection, can identify 11 types of refactoring operations with relatively high precision. In contrast, for other languages such as Java, state-of-the-art tools are capable of detecting a much more comprehensive list of refactorings. For example, Rminer can detect 99 types of refactoring for Java projects. Inspired by previous work that leverages commit messages to detect refactoring, we introduce MLRefScanner, a prototype tool that applies machine-learning techniques to detect refactoring commits in ML Python projects. MLRefScanner detects commits involving both ML-specific refactoring operations and additional refactoring operations beyond the scope of state-of-the-art refactoring detection tools. To demonstrate the effectiveness of our approach, we evaluate MLRefScanner on 199 ML open-source libraries and frameworks and compare MLRefScanner against other refactoring detection tools for Python projects. Our findings show that MLRefScanner outperforms existing tools in detecting refactoring-related commits, achieving an overall precision of 94% and recall of 82% for identifying refactoring-related commits. MLRefScanner can identify commits with ML-specific and additional refactoring operations compared to state-of-the-art refactoring detection tools. When combining MLRefScanner with PyRef, we can further increase the precision and recall to 95% and 99%, respectively. MLRefScanner provides a valuable contribution to the Python ML community, as it allows ML developers to detect refactoring-related commits more effectively in their ML Python projects. Our study sheds light on the promising direction of leveraging machine learning techniques to detect refactoring activities for other programming languages or technical domains where the commonly used rule-based refactoring detection approaches are not sufficient.  \nCCS Concepts: • Software and its engineering;  \nAdditional Key Words and Phrases: code refactoring, refactoring detection, python refactoring, code quality, refactoring evolution  \nACM Reference Format:  \nShayan Noei, Heng Li, and Ying Zou. 2018. Detecting Refactoring Commits in Machine Learning Python Projects: A Machine  \nLearning-Based Approach. 1, 1 (April 2018), 22 pages. [https://doi.org/XXXXXXX.XXXXXXX](https://doi.org/XXXXXXX.XXXXXXX)  \nAuthors’ addresses: Shayan Noei, [s.noei@queensu.ca](s.noei@queensu.ca), Queen’s University, Kingston, Canada; Heng Li, [heng.li@polymtl.ca](heng.li@polymtl.ca), Polytechnique Montréal,  \nMontréal, Canada; Ying Zou, [ying.zou@queensu.ca](ying.zou@queensu.ca),","cbCaifGtCGyD0P9i","https://ap.wps.com/l/cbCaifGtCGyD0P9i","pdf",908053,1,22,"English","en",105,"# Introduction\n## Refactoring and the need for detection\n## Limitations of existing tools in Python ML projects\n# Proposed approach\n## MLRefScanner design using commit messages\n# Evaluation\n## Dataset and comparison setup\n## Results for precision and recall\n# Results and implications\n## Combining MLRefScanner with PyRef\n## Future directions","[{\"question\":\"Why is detecting refactoring commits especially important in ML Python projects?\",\"answer\":\"ML Python libraries evolve through a data-driven process, producing refactoring types that may be ML-specific and not well captured by existing Python tooling, making accurate detection crucial for maintainability insights.\"},{\"question\":\"How does MLRefScanner detect refactoring commits?\",\"answer\":\"MLRefScanner applies machine-learning techniques inspired by prior work using commit messages, aiming to identify commits with ML-specific refactoring operations and additional refactorings beyond rule-based tool coverage.\"},{\"question\":\"What performance did MLRefScanner achieve and how can it be improved?\",\"answer\":\"On 199 ML open-source libraries, MLRefScanner achieved 94% precision and 82% recall for refactoring-related commits; combining it with PyRef further increased precision and recall to 95% and 99%, respectively.\"}]","Detecting Refactoring Commits in Machine Learning Python Projects - A Machine Learning-Based Approach | PDF",1785682516,55,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":87,"head_meta":89,"extra_data":91,"updated_unix":28},"detecting-refactoring-commits-in-machine-learning-python-projects-a-machine-learning-based-approach","",{"@graph":36,"@context":86},[37,54,69],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/detecting-refactoring-commits-in-machine-learning-python-projects-a-machine-learning-based-approach/118235/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":63,"encodingFormat":61,"isAccessibleForFree":64,"interactionStatistic":65},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-05","2026-08-02",true,{"@type":66,"interactionType":67,"userInteractionCount":20},"InteractionCounter",{"@type":68},"ViewAction",{"@type":70,"mainEntity":71},"FAQPage",[72,78,82],{"name":73,"@type":74,"acceptedAnswer":75},"Why is detecting refactoring commits especially important in ML Python projects?","Question",{"text":76,"@type":77},"ML Python libraries evolve through a data-driven process, producing refactoring types that may be ML-specific and not well captured by existing Python tooling, making accurate detection crucial for maintainability insights.","Answer",{"name":79,"@type":74,"acceptedAnswer":80},"How does MLRefScanner detect refactoring commits?",{"text":81,"@type":77},"MLRefScanner applies machine-learning techniques inspired by prior work using commit messages, aiming to identify commits with ML-specific refactoring operations and additional refactorings beyond rule-based tool coverage.",{"name":83,"@type":74,"acceptedAnswer":84},"What performance did MLRefScanner achieve and how can it be improved?",{"text":85,"@type":77},"On 199 ML open-source libraries, MLRefScanner achieved 94% precision and 82% recall for refactoring-related commits; combining it with PyRef further increased precision and recall to 95% and 99%, respectively.","https://schema.org",{"og:url":52,"og:type":88,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":90,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":93},[94,98,102,106,111,116,121,124,129,132,136],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":95,"show_sort_weight":96,"slug":97},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":99,"show_sort_weight":100,"slug":101},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":103,"show_sort_weight":104,"slug":105},"Exam",70,"exam",{"id":107,"doc_module":4,"doc_module_name":46,"category_name":108,"show_sort_weight":109,"slug":110},5,"Comic",60,"comic",{"id":112,"doc_module":4,"doc_module_name":46,"category_name":113,"show_sort_weight":114,"slug":115},6,"Technology",50,"technology",{"id":117,"doc_module":4,"doc_module_name":46,"category_name":118,"show_sort_weight":119,"slug":120},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":122,"slug":123},30,"research-report",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":126,"show_sort_weight":127,"slug":128},9,"Religion & Spirituality",20,"religion-spirituality",{"id":127,"doc_module":4,"doc_module_name":46,"category_name":130,"show_sort_weight":127,"slug":131},"World Cup","world-cup",{"id":133,"doc_module":4,"doc_module_name":46,"category_name":134,"show_sort_weight":133,"slug":135},10,"Lifestyle","lifestyle",{"id":137,"doc_module":4,"doc_module_name":46,"category_name":138,"show_sort_weight":107,"slug":139},19,"General","general"]