×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What are accuracy, precision, recall, and F1 scores?

by Sławomir Kublin / Tuesday, 16 June 2026 / Published in Artificial Intelligence, EITC/AI/GCML Google Cloud Machine Learning, Introduction, What is machine learning

Accuracy, precision, recall, and F1 score are fundamental metrics used to evaluate the performance of classification models in machine learning. These metrics provide quantitative measures for assessing how well a model predicts the classes of input data, particularly in the context of supervised learning tasks such as binary classification, multiclass classification, and, in some adaptations, multilabel classification. Each metric captures a distinct aspect of model performance, and their interpretation is closely linked to the confusion matrix, a table that summarizes the performance of a classification algorithm by displaying the counts of true positives, true negatives, false positives, and false negatives.

1. Confusion Matrix: Foundation for Metrics

A confusion matrix is a 2×2 table (for binary classification) that enables the visualization of the performance of an algorithm. The matrix is typically organized as follows:

Predicted Positive Predicted Negative
Actual Positive True Positive (TP) False Negative (FN)
Actual Negative False Positive (FP) True Negative (TN)

– True Positive (TP): The number of instances that are correctly labeled as positive by the model.
– True Negative (TN): The number of instances that are correctly labeled as negative.
– False Positive (FP): The number of instances that are incorrectly labeled as positive (also called Type I error).
– False Negative (FN): The number of instances that are incorrectly labeled as negative (also called Type II error).

All of the discussed metrics derive their calculations from these four quantities.

2. Accuracy

Accuracy is the proportion of all predictions (both positive and negative) that the model correctly identifies. It is calculated as the ratio of correctly predicted observations (both TPs and TNs) to the total number of observations. Mathematically:

    \[ \text{Accuracy} = \frac{TP + TN}{TP + TN + FP + FN} \]

Accuracy provides an overall measure of correctness. For example, if a spam detection model classifies 950 emails correctly out of 1,000 total emails, the accuracy is 95%. However, accuracy may not be an informative metric when dealing with imbalanced datasets, where one class greatly outnumbers the other. In such cases, a model may achieve high accuracy by simply predicting the majority class all the time, thus misleadingly inflating performance.

3. Precision

Precision, also known as Positive Predictive Value, measures the proportion of positive predictions that are actually correct. It assesses the model's ability to avoid false positives. Precision is given by:

    \[ \text{Precision} = \frac{TP}{TP + FP} \]

Precision is especially relevant when the cost of a false positive is high. For instance, in email spam detection, if the model predicts that an email is spam, precision indicates how many of the emails flagged as spam are indeed spam. High precision means that when the model flags something as positive, it is likely to be correct.

For example, consider a medical diagnostic test for a rare disease. If the model predicts 10 positive cases, out of which 8 are truly positive (TP) and 2 are false positives (FP), the precision is 8/10 = 0.8 or 80%.

4. Recall

Recall, also known as Sensitivity or True Positive Rate, measures the proportion of actual positive cases that are correctly identified by the model. Recall focuses on minimizing false negatives and is given by:

    \[ \text{Recall} = \frac{TP}{TP + FN} \]

Recall is important in domains where missing a positive case is significantly more costly than a false alarm. For example, in cancer detection, failing to identify a positive case (i.e., a patient with cancer) could have severe consequences; thus, recall is prioritized.

Continuing the medical example, if there are 20 actual positive cases, but the model only correctly identifies 8 of them (TP), while missing 12 (FN), the recall is 8/20 = 0.4 or 40%.

5. The Trade-Off Between Precision and Recall

Precision and recall often have an inverse relationship; improving one can reduce the other. For example, by adjusting the threshold for positive classification, a model can be made more conservative (increasing precision but reducing recall) or more inclusive (increasing recall but reducing precision). This trade-off is context-dependent and should be managed based on the application’s requirements.

For instance, in financial fraud detection, high recall is important to catch as many fraudulent transactions as possible, even at the cost of some false positives (lower precision). Conversely, if the cost of investigating false alarms is very high, precision may be prioritized.

6. F1 Score

The F1 score provides a single metric that combines both precision and recall using their harmonic mean. It is especially useful when a balance between precision and recall is desired, or when the class distribution is uneven. The harmonic mean is preferred over the arithmetic mean because it punishes extreme values more; a high F1 score is only possible if both precision and recall are high.

    \[ \text{F1 Score} = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}} \]

For the medical example above, with precision = 0.8 and recall = 0.4, the F1 score would be:

    \[ F1 = 2 \times \frac{0.8 \times 0.4}{0.8 + 0.4} = 2 \times \frac{0.32}{1.2} = 2 \times 0.2667 = 0.5333 \]

The F1 score ranges from 0 to 1, where 1 indicates perfect precision and recall.

7. Application to Imbalanced Datasets

In real-world applications, datasets are often imbalanced, meaning that one class (typically the negative or "normal" class) far outnumbers the other. For instance, in fraud detection, the number of fraudulent transactions is much smaller than the number of legitimate ones. In such cases, accuracy becomes a less informative metric, as a model could achieve high accuracy by simply always predicting the majority class.

Precision, recall, and F1 score provide more informative metrics in these scenarios:

– High Precision: Indicates few false positives. In fraud detection, this would mean few legitimate transactions are flagged as fraud.
– High Recall: Indicates few false negatives. In fraud detection, this would mean most fraudulent transactions are identified.
– F1 Score: Provides a balance, which is especially useful when neither false positives nor false negatives can be ignored.

8. Examples with Calculations

Consider a binary classification task with the following confusion matrix:

Predicted Positive Predicted Negative
Actual Positive 70 30
Actual Negative 10 90

From this, we have:

– TP = 70
– FN = 30
– FP = 10
– TN = 90

Calculations:

– Accuracy: (TP + TN) / (TP + TN + FP + FN) = (70 + 90) / (70 + 90 + 10 + 30) = 160 / 200 = 0.80 (80%)
– Precision: TP / (TP + FP) = 70 / (70 + 10) = 70 / 80 = 0.875 (87.5%)
– Recall: TP / (TP + FN) = 70 / (70 + 30) = 70 / 100 = 0.70 (70%)
– F1 Score: 2 x (Precision x Recall) / (Precision + Recall) = 2 x (0.875 x 0.70) / (0.875 + 0.70) = 2 x 0.6125 / 1.575 = 1.225 / 1.575 ≈ 0.778 (77.8%)

This example illustrates that while the accuracy is high, the model still misses 30 positive cases (false negatives), which could be significant depending on the application.

9. Multiclass and Multilabel Extensions

When dealing with more than two classes (multiclass classification), these metrics are typically computed per class and then averaged:

– Macro-average: Calculates the metric for each class independently and then takes the average, treating all classes equally.
– Micro-average: Aggregates the contributions of all classes to compute the average metric, giving more weight to classes with more samples.
– Weighted-average: Averages the metrics for each class, weighted by the number of true instances for each class.

For multilabel classification, where each instance can belong to multiple classes simultaneously, the same metrics are computed for each label and then averaged according to the same schemes.

10. Practical Considerations and Metric Selection

The choice of evaluation metric depends on the specific context and risks of the application. In medical diagnosis, recall is often prioritized to minimize the risk of missing positive cases. For spam filtering, precision may be more important to ensure legitimate emails are not incorrectly classified as spam. The F1 score is particularly useful when one needs a balanced measure that takes both types of errors into account, especially in imbalanced datasets.

11. Integration in Google Cloud Machine Learning

In the context of Google Cloud Machine Learning and similar platforms, these metrics are computed and visualized as part of model evaluation workflows. The platform often provides built-in functions to calculate these values on validation and test datasets, allowing practitioners to compare models and select the best-performing one based on the metrics most relevant to their business or research goals.

12. Summary Paragraph

Understanding accuracy, precision, recall, and F1 score is fundamental for evaluating classification models. Each metric provides distinct information: accuracy gives an overall fraction of correct predictions; precision quantifies the correctness of positive predictions; recall measures the ability to find all positive instances; and the F1 score balances the trade-off between precision and recall. The choice of metric should align with the real-world costs associated with different types of errors, and their interpretation should always consider the underlying class distribution and the specific requirements of the application.

Other recent questions and answers regarding What is machine learning:

  • What is the difference between machine learning and artificial intelligence?
  • Is AI a subset of machine learning and not vice versa?
  • How to create a program to predict possible failures in a car? What programming language and libraries to use? And what algorithm to use?
  • How can machine learning help in supply chain prediction and risk management?
  • What are prominent and prospective specializations in AI?
  • How can machine learning help me as an experienced translator and conference interpreter?
  • How can I use machine learning in manufacturing?
  • Finance or, better, trading (stocks, crypto, ETFs,…) requires a lot of data to be analyzed. How can I create a ML model to take into consideration all those factors—financial and non-financial, like human psychology, political events, weather?
  • Would it be possible to use data with multiple language datasets included, where the algorithm has to use data from sources that are in different languages?
  • Given that I want to train a model to recognize plastic types correctly, 1. What should be the correct model? 2. How should the data be labeled? 3. How do I ensure the data collected represents a real-world scenario of dirty samples?

View more questions and answers in What is machine learning

More questions and answers:

  • Field: Artificial Intelligence
  • Programme: EITC/AI/GCML Google Cloud Machine Learning (go to the certification programme)
  • Lesson: Introduction (go to related lesson)
  • Topic: What is machine learning (go to related topic)
Tagged under: Artificial Intelligence, Classification, F1 Score, Machine Learning, Metrics, Model Evaluation
Home » Artificial Intelligence » EITC/AI/GCML Google Cloud Machine Learning » Introduction » What is machine learning » » What are accuracy, precision, recall, and F1 scores?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (117)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.
Eligibility for EITCA Academy 90% EITCI DSJC Subsidy support
90% of EITCA Academy fees subsidized in enrolment

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP

    We care about your privacy

    EITCI uses cookies and similar technologies to keep this site secure, remember your choices, provide personalized experience, measure the traffic, serve more relevant content and certification programmes. You can accept all cookies or customize your preferences. Cookies are variables used to store website specific information on your device to facilitate processing of data for personalized website visit, such as login to your account, accessing the programmes, placing enrolment orders in chosen programmes and improving your EITC certification journey. You can change or withdraw your consent at any time by clicking the Consent Preferences button at the left-bottom of your screen. We respect your choices and are committed to providing you with a transparent and secure browsing experience, which may be limited when cookies aren't accepted. For more details refer to the Privacy Policy
    Customize Consent Preferences
    We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.
    The cookies categorized as Necessary are stored on your browser as they are essential for enabling the basic functionalities of the site.
    To learn more about how Google processes personal information, visit: Google privacy policy

    Necessary

    Always Active

    Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

    Functional

    Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

    Preferences

    Stores personalization choices such as interface preferences.

    External media and social features

    Allows embedded video, social, chat, and external interactive services that may set their own cookies. Keep off until the user chooses these features.

    Analytics

    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

    Marketing and conversions

    Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

    CHAT WITH SUPPORT
    Do you have any questions?
    Attach files with the paperclip or paste screenshots into the message box (Ctrl+V). Max 5 file(s), 10 MB each.
    We will reply here and by email. Your conversation is tracked with a support token.