Artificial Intelligence (AI) and Machine Learning (ML) are pervasive in the current computer science landscape. Yet, there still exists a lack of software engineering experience and best practices in this field. One such best practice, static code analysis, can be used to find code smells, i.e., (potential) defects in the source code, refactoring opportunities, and violations of common coding standards. Our research set out to discover the most prevalent code smells in ML projects. We gathered a dataset of 74 open-source ML projects, installed their dependencies and ran Pylint on them. This resulted in a top 20 of all detected code smells, per category. Manual analysis of these smells mainly showed that code duplication is widespread and that the PEP8 convention for identifier naming style may not always be applicable to ML code due to its resemblance with mathematical notation. More interestingly, however, we found several major obstructions to the maintainability and reproducibility of ML projects, primarily related to the dependency management of Python projects. We also found that Pylint cannot reliably check for correct usage of imported dependencies, including prominent ML libraries such as PyTorch.


翻译:目前在计算机科学领域,人工智能(AI)和机器学习(ML)十分普遍,然而,这方面仍然缺乏软件工程经验和最佳做法。这方面的一种最佳做法,即静态代码分析,可以用来寻找代码气味,即源代码(潜在)缺陷、重构机会和违反共同编码标准。我们的研究旨在发现ML项目中最普遍的代码气味。我们收集了74个开放源代码ML项目数据集,安装了它们的依赖性,并在这些项目上建立了Pylint。这导致每类所有检测到的代码气味达到前20位。对这些气味的手工分析主要表明,代码重复现象十分普遍,而且由于源代码代码与数学符号的相似,PEP8标识命名风格公约可能并非总适用于ML代码。但更有趣的是,我们发现ML项目在维护和可复制性方面存在若干重大障碍,主要与Python项目的依赖性管理有关。我们还发现,Pylint无法可靠地检查进口可靠性的使用情况,包括著名的ML图书馆。

0
下载
关闭预览

相关内容

Linux导论,Introduction to Linux,96页ppt
专知会员服务
75+阅读 · 2020年7月26日
【干货书】真实机器学习,264页pdf,Real-World Machine Learning
吴恩达新书《Machine Learning Yearning》完整中文版
专知会员服务
144+阅读 · 2019年10月27日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
2019年机器学习框架回顾
专知会员服务
35+阅读 · 2019年10月11日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
99+阅读 · 2019年10月9日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
Facebook PyText 在 Github 上开源了
AINLP
7+阅读 · 2018年12月14日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
carla 体验效果 及代码
CreateAMind
7+阅读 · 2018年2月3日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
Adversarial Variational Bayes: Unifying VAE and GAN 代码
CreateAMind
7+阅读 · 2017年10月4日
【推荐】Python机器学习生态圈(Scikit-Learn相关项目)
机器学习研究会
6+阅读 · 2017年8月23日
Learning in the Frequency Domain
Arxiv
11+阅读 · 2020年3月12日
Arxiv
14+阅读 · 2020年2月6日
Arxiv
22+阅读 · 2019年11月24日
A Comprehensive Survey on Transfer Learning
Arxiv
117+阅读 · 2019年11月7日
Mobile big data analysis with machine learning
Arxiv
6+阅读 · 2018年8月2日
VIP会员
相关VIP内容
Linux导论,Introduction to Linux,96页ppt
专知会员服务
75+阅读 · 2020年7月26日
【干货书】真实机器学习,264页pdf,Real-World Machine Learning
吴恩达新书《Machine Learning Yearning》完整中文版
专知会员服务
144+阅读 · 2019年10月27日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
2019年机器学习框架回顾
专知会员服务
35+阅读 · 2019年10月11日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
99+阅读 · 2019年10月9日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
相关资讯
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
Facebook PyText 在 Github 上开源了
AINLP
7+阅读 · 2018年12月14日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
carla 体验效果 及代码
CreateAMind
7+阅读 · 2018年2月3日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
Adversarial Variational Bayes: Unifying VAE and GAN 代码
CreateAMind
7+阅读 · 2017年10月4日
【推荐】Python机器学习生态圈(Scikit-Learn相关项目)
机器学习研究会
6+阅读 · 2017年8月23日
相关论文
Top
微信扫码咨询专知VIP会员