Skip to content

On the Relation between Code Quality and Machine Learning Performance: A Large-scale Empirical Study

Sep 2026 · 0 citations
Computer Science

TL;DR

A large-scale empirical study of 265,363 Python notebooks submitted to Kaggle competitions found that competition expertise correlates with better performance, fewer ML-specific violations, and slightly more Python errors and refactoring violations.

Abstract

Context: Computational notebooks are the standard environment for machine learning (ML) development. Within the ML community, model performance is often the primary considered metric, and code quality is treated as a secondary concern. This prioritization relies on a largely untested assumption that code quality and ML performance are unrelated. Practitioners also reuse existing code that may come from notebooks selected through social signals (popularity, author expertise) whose reliability as quality proxies has never been assessed. Objective: We empirically investigated the relationship between code quality and ML performance in notebooks, and evaluated whether popularity and author expertise give indication on code quality or performance. Method: We conducted a large-scale empirical study of 265,363 Python notebooks submitted to Kaggle competitions. We assessed code quality with two static analysis tools: Pylint, capturing general Python code quality, and SonarQube, configured with a profile of 34 rules targeting data-science and ML-specific practices. Results: The relationship between code quality and performance depends on the notion of quality considered. General Python code quality is decoupled from ML performance, showing negligible or non-significant correlations across all observations. In contrast, ML-specific violations exhibit a consistent, small negative association with performance that persists across all observations. The popularity of a notebook does not give information on the code quality or performance. Code expertise provides no information on quality or performance, but competition expertise correlates with better performance, fewer ML-specific violations, and slightly more Python errors and refactoring violations.

View source

Similar papers

#software testing Preprint Aug 2026

Benchmarking the Titans: A Multi-Dimensional Empirical Evaluation of LLM Code Generation Quality in the .NET Ecosystem

An automated, multi-dimensional evaluation framework for C# code generation, applying it to four state-of-the-art LLMs: GPT, Gemini, Claude, and Grok is presented and a substantial gap between correctness and quality attributes is revealed.

Seyed Mohammad Mahdi Ghalandarian, Majid Bazargani, Masoumeh Taromirad · 0 citations
#artificial intelligence Preprint Sep 2026

What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code

This work compares human-written and AI-generated code at scale, characterize structural complexity and statistical naturalness, and map static-analysis findings onto Orthogonal Defect Classification for defects and the Common Weakness Enumeration for vulnerabilities, making authors and languages directly comparable.

Cristina Improta, Pietro Liguori, D. Cotroneo · 0 citations
Review Aug 2026

Vibe Coding: Practice, Performance, Productivity, and Risk -A State-of-the-Art Review

This state-of-the-art review assembles that evidence across a cross-disciplinary corpus spanning software engineering, human-computer interaction, labour economics, security research, governance, and education, finding the early benchmarks saturated but task-level capability uneven.

D. Michels, Mutaz Abu Ghazaleh, F. Lazzari et al. · 0 citations
Conference Sep 2026

A Model of Software Code Quality Analysis, Assessment, and Improvement System

Existing code analysis systems address individual aspects of software quality (complexity, duplication, style) but do not combine multi-level analysis, metric aggregation, and learning-based inference within a single formal framework, nor do they close the loop between refactoring outcomes and assessment. This paper pr...

Ihor Prokofiev, Oleg Savenko · 0 citations
Preprint Sep 2026

Assessing the Construct Validity of Object-Oriented, Class-Level Code Quality Metrics

The results strongly support the construct validity of 24 code quality metrics and reveal Coupling and Inheritance are revealed as multidimensional constructs, since they require measuring two different concepts, revealed as sub-categories in the analysis.

Hera Arif, M. Kuutila, Paul Ralph · 0 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.