Machine Learning Models for Automatic Classification of Programming Tasks in Python

IF 1 Q4 COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS
Ginna Viviana Leytón-Yela;Hector Mora;Jesus Insuasti;John Barco-Jimenez
{"title":"Machine Learning Models for Automatic Classification of Programming Tasks in Python","authors":"Ginna Viviana Leytón-Yela;Hector Mora;Jesus Insuasti;John Barco-Jimenez","doi":"10.1109/RITA.2026.3703006","DOIUrl":null,"url":null,"abstract":"This article presents a comparative analysis of automatic error classification in Python programming tasks involving loops, with a focus on machine learning approaches for identifying error types. Three experiments were conducted: the first evaluated traditional machine learning algorithms; the second explored alternative kernel functions in SVM and MLP algorithms; and the third involved two multi-input deep learning models. Following the CRISP-DM methodology, we compiled a dataset of 3000 looped programming tasks, each including a problem description in English, a Python solution, and a classification based on state errors formulated by Gries theory (initial S, final E, state transformation T, and their combinations, totaling seven labels). In preprocessing, the code was partitioned using its AST to align it with Gries states, and both the problem descriptions and code snippets were embedded with Bert, Code-bert, and Graph-code-bert. Ablations were performed to approximate the optimal solutions for each algorithm as closely as possible. The results showed that traditional machine learning algorithms achieved up to 90% accuracy and an MCC of 83%, while alternative kernels marginally improved performance but did not surpass that of traditional algorithms. Deep learning models (ANN-GCB) achieved the best balance, with 94% accuracy and 91% MCC, respectively, demonstrating their superiority for this classification task. The model was validated with external sources from different repositories, yielding an 85% success rate, and with a group of 138 students, achieving a 96.7% correct or partially correct classification rate.","PeriodicalId":38963,"journal":{"name":"Revista Iberoamericana de Tecnologias del Aprendizaje","volume":"21 ","pages":"446-455"},"PeriodicalIF":1.0000,"publicationDate":"2026-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=11563489","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Revista Iberoamericana de Tecnologias del Aprendizaje","FirstCategoryId":"1085","ListUrlMain":"https://ieeexplore.ieee.org/document/11563489/","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/6/15 0:00:00","PubModel":"Epub","JCR":"Q4","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0

Abstract

This article presents a comparative analysis of automatic error classification in Python programming tasks involving loops, with a focus on machine learning approaches for identifying error types. Three experiments were conducted: the first evaluated traditional machine learning algorithms; the second explored alternative kernel functions in SVM and MLP algorithms; and the third involved two multi-input deep learning models. Following the CRISP-DM methodology, we compiled a dataset of 3000 looped programming tasks, each including a problem description in English, a Python solution, and a classification based on state errors formulated by Gries theory (initial S, final E, state transformation T, and their combinations, totaling seven labels). In preprocessing, the code was partitioned using its AST to align it with Gries states, and both the problem descriptions and code snippets were embedded with Bert, Code-bert, and Graph-code-bert. Ablations were performed to approximate the optimal solutions for each algorithm as closely as possible. The results showed that traditional machine learning algorithms achieved up to 90% accuracy and an MCC of 83%, while alternative kernels marginally improved performance but did not surpass that of traditional algorithms. Deep learning models (ANN-GCB) achieved the best balance, with 94% accuracy and 91% MCC, respectively, demonstrating their superiority for this classification task. The model was validated with external sources from different repositories, yielding an 85% success rate, and with a group of 138 students, achieving a 96.7% correct or partially correct classification rate.
Python编程任务自动分类的机器学习模型
本文介绍了涉及循环的Python编程任务中的自动错误分类的比较分析,重点是用于识别错误类型的机器学习方法。进行了三个实验:第一个实验评估了传统的机器学习算法;第二部分探讨了支持向量机和MLP算法中的替代核函数;第三个涉及两个多输入深度学习模型。遵循CRISP-DM方法,我们编译了3000个循环编程任务的数据集,每个任务包括英语问题描述,Python解决方案和基于Gries理论(初始S,最终E,状态转换T及其组合,共7个标签)制定的状态错误分类。在预处理中,使用AST对代码进行分区,使其与Gries状态保持一致,并且问题描述和代码片段都嵌入了Bert、code- Bert和Graph-code-bert。进行消融以尽可能接近每个算法的最优解。结果表明,传统机器学习算法的准确率高达90%,MCC为83%,而替代内核的性能略有提高,但没有超过传统算法。深度学习模型(ANN-GCB)达到了最好的平衡,准确率分别为94%,MCC为91%,证明了它们在该分类任务中的优势。该模型使用来自不同存储库的外部资源进行验证,获得85%的成功率,并且在138名学生的组中,实现了96.7%的正确或部分正确的分类率。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
CiteScore
4.30
自引率
0.00%
发文量
45
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书