• News
  • Spirituality
    • Dream Interpretation
    • Angel Numbers
    • Tarot
    • Prayers
    • Spells
  • Health
  • Science
  • Celebs
  • Betting

How Are Code Smells Used In Machine Learning?


The code smells catalogue assists data scientists and programmers in the creation and maintenance of high-quality machine learning program code. Machine learning has grown in prominence in recent years.

Machine learning techniques have been intensively researched in academia and are utilised in industry to provide economic value. However, requirements for code quality in machine learning applications are lacking.

Code smells, in particular, have received little attention in this sector. Although machine learning code is typically implemented as a minor component of a larger system, it plays a vital role in its core functionality. As a result, making sure the code is good is important to avoid problems in the long run.

A group of researchers from Delft University of Technology and AI for Fintech Research in the Netherlands led by Haiyin Zhang, Lus Cruz, and Arie van Deursen proposed and identified a list of 22 machine learning-specific code smells culled from papers, grey literature, GitHub commits, and Stack Overflow posts.

They highlighted each odour with a description of its background, potential long-term difficulties, and offered solutions. There was evidence from both academic and non-academic sources that they also linked them to the right pipeline stage.

COPYRIGHT_SZ: Published on https://stationzilla.com/code-smells/ by Suleman Shah on 2022-04-26T08:19:29.666Z

Smelling Source Code Using Deep Learning

Code Smells Collection And Description

The researchers used academic literature, grey literature, community-based coding Q&A platforms (like Stack Overflow), and public software repositories to collect machine learning-specific code smells (with GitHub).

They mined articles, grey literature, reused existing bug datasets, and conducted Stack Overflow mining as well. They then triangulated their gathered odours with the recommendations offered in the machine learning library's official documentation. Finally, the code smell catalogue was validated.

There were a total of 22 machine learning-specific code odours that were collected and described. The researchers presented a broad explanation for each smell, followed by the setting of the smell, the problem with its presence, and the solution.

Finally, they summarised all of the scents, including the references that support the smell, the stage of the machine learning pipeline where they are most important, and the major effect of having those smells.


The catalogue investigates recurring code issues from many sources to assist in understanding prevalent errors in machine learning application development. Because many data scientists lack software engineering experience and are not up to date on software engineering best practises, their catalogue of smells helps to overcome this barrier by offering some guidance for designing machine learning applications.

New versions of machine learning libraries are released on a regular basis. They re-used the "TensorFlow Bugs" replication package and discovered that several instances had been deprecated due to TensorFlow's upgrading to version 2.

As a result, they anticipated that new API-specific code smells will emerge with new library versions and features. In reality, the findings suggest that the majority of API-related odours are only recorded in grey literature rather than in literature.

Compiling a catalogue of code smells aids in the promotion of a collaborative effort between practitioners and academics. Because the ecosystem of artificial intelligence frameworks is changing so quickly, some smells may become obsolete in the meanwhile.

They predicted that three code smells in their catalogue would be deemed temporary: Dataframe Conversion API Misused, Matrix Multiplication API Misused, and Gradients Not Cleared Before Backward Propagation.

Temporary smells may be deprecated after a few years, whilst some smells are considered to last a long time. However, these three smells are significant and should be recognised to assist practitioners in preventing problems down the road.


They gathered the code smells from a variety of sources, including mining 1750 publications, mining 2170 grey literature items, utilising existing bug datasets, which included 88 Stack Overflow posts and 87 GitHub commits, and gathering 403 complimentary Stack Overflow postings.

They examined the pitfalls described in the blogs and assessed whether or not to consider them a code smell. They gathered 22 odours from the code, including generic and API-specific smells. They also classified the code smell according to the pipeline phases and its impact.

This has aided the machine learning community in improving code quality. It would be interesting to find out how common these code smells are in real-world machine learning systems and how useful it would be to have a list of machine learning-specific code smells.

Share: Twitter | Facebook | Linkedin

About The Authors

Suleman Shah

Suleman Shah

Recent Articles

  • Astrological Sign For February - Aquarius And Pisces


    Astrological Sign For February - Aquarius And Pisces

    Astrology is a fascinating study of the stars and their influence on human life. Each astrological sign is associated with a set of personality traits and tendencies, as well as its own unique set of challenges and opportunities. The astrological sign for February is Aquarius, and this sign is known for its individuality, creativity, and humanitarianism.

  • What Are January Zodiac Signs?


    What Are January Zodiac Signs?

    In this article you will learn what are january zodiac signs. The zodiac sign is determined by the position of the sun on the day of a person's birth. In astrology, the zodiac is divided into 12 equal parts, each represented by a specific sign. If you were born in January, your zodiac sign is either Capricorn or Aquarius.

  • GPT-3 - Architecture, Capabilities, Applications And More


    GPT-3 - Architecture, Capabilities, Applications And More

    GPT-3 (Generative Pretrained Transformer-3) is the third iteration of OpenAI’s language model and considered as one of the largest and most advanced AI language models to date. It has demonstrated impressive performance in several natural language processing tasks, such as language translation, summarization, question-answering, and even creative writing.

  • Gastroesophageal Reflux Disease - A Guide To Managing Its Symptoms


    Gastroesophageal Reflux Disease - A Guide To Managing Its Symptoms

    Gastroesophageal Reflux Disease (GERD) is a chronic digestive disorder characterized by the backward flow of stomach acid and other contents into the esophagus. This can cause discomfort and damage to the esophageal lining.

  • How To Prevent And Treat Piles?


    How To Prevent And Treat Piles?

    Piles, also known as hemorrhoids, are swollen veins in the anus and lower rectum. They can cause discomfort, itching, and rectal bleeding and can be the result of straining during bowel movements, prolonged sitting, pregnancy, chronic constipation or diarrhea, a low-fiber diet, aging, and genetics.

  • Solutions For Allergic Rhinitis Sufferers


    Solutions For Allergic Rhinitis Sufferers

    Allergic Rhinitis, also known as hay fever, is a common condition that affects millions of people worldwide. It is an allergic reaction to environmental triggers such as pollen, dust mites, pet dander, and mold, among others.

  • The Impact Of Polycystic Ovary Syndrome On Women's Health And Well-Being


    The Impact Of Polycystic Ovary Syndrome On Women's Health And Well-Being

    Polycystic Ovary Syndrome (PCOS) is a common hormonal disorder that affects women of reproductive age. It is characterized by the presence of multiple cysts on the ovaries, which can lead to irregular menstrual cycles and hormonal imbalances. In addition to physical symptoms, PCOS can also have a significant impact on a woman's mental and emotional well-being.

  • Is It Normal For Dogs To Have Wet Dreams?

    Dream Interpretation

    Is It Normal For Dogs To Have Wet Dreams?

    In this article, we are going to discuss is it normal for dogs to have wet dreams. Male dog owners have observed that their canines occasionally appear to be having what people refer to as "wet dreams." They have observed their dogs getting erections, having incredibly swollen testicles, and acting like they were mounting a female dog by rubbing or thrusting (sometimes even resulting in a clear, whitish discharge).

  • Earthquake In Turkey And Syria Claims Over 4,300 Lives


    Earthquake In Turkey And Syria Claims Over 4,300 Lives

    On February 4, 2023, a 7.8 magnitude earthquake in Turkey and Syria, left a trail of destruction and devastation in its wake. Over 4,300 people were killed in the disaster, and thousands more were injured. The earthquake has damaged a lot of buildings and infrastructure, leaving a lot of people without homes and without the things they need.

  • Acidity - Navigating The Challenges And Finding Relief

  • Diabetes - A Step By Step Guide

  • Nux Vomica - The Miracle Herb For Digestive Issues

  • Dealcoholization In Histopathology - A Key Step In Sample Preparation

  • Dealcoholization Is Also Known As Alcohol Free Living