Dataset Open Access

Development, evaluation, and validation of machine learning models for COVID-19 detection based on routine blood tests

Cabitza, Federico; Campagner, Andrea; Ferrari, Davide; Di Resta, Chiara; Ceriotti, Daniele; Sabetta, Eleonora; Colombini, Alessandra; De Vecchi, Elena; Banfi, Giuseppe; Locatelli, Massimo; Carobene, Anna

The .xlsx dataset includes all patients used for training, internal-external and external validation: these can be distinguished by looking at the ID (first column) in the dataset: those in format Axxxx-<Date> are the data used for the training, those in the format 20xx are the data used for the internal-external validation, while the remaining data were used for external validation.

As regards the features: for the Target feature the value 1 stands for "Positive to COVID-19" while the value 0 stands for "Negative to COVID-19"; while for the Sex feature the value 1 stands for "Male" while the value 0 stands for "Female".

The full article is available at:

A pre-print version of the article is also available on MedrXiv:


Background The rRT-PCR test, the current gold standard for the detection of coronavirus disease (COVID-19), presents with known shortcomings, such as long turnaround time, potential shortage of reagents, false-negative rates around 15–20%, and expensive equipment. The hematochemical values of routine blood exams could represent a faster and less expensive alternative. 

Methods Three different training data set of hematochemical values from 1,624 patients (52% COVID-19 positive), admitted at San Raphael Hospital (OSR) from February to May 2020, were used for developing machine learning (ML) models: the complete OSR dataset (72 features: complete blood count (CBC), biochemical, coagulation, hemogasanalysis and CO-Oxymetry values, age, sex and specific symptoms at triage) and two sub datasets (COVID-specific and CBC dataset, 32 and 21 features respectively). 58 cases (50% COVID-19 positive) from another hospital, and 54 negative patients collected in 2018 at OSR, were used for internal-external and external validation.

Results We developed five ML models: for the complete OSR dataset, the area under the receiver operating characteristic curve (AUC) for the algorithms ranged from 0.83 to 0.90; for the COVID-specific dataset from 0.83 15 to 0.87; and for the CBC dataset from 0.74 to 0.86. The validations also achieved good results: respectively, AUC 16 from 0.75 to 0.78; and specificity from 0.92 to 0.96. 

Conclusions ML can be applied to blood tests as both an adjunct and alternative method to rRT-PCR for the fast and cost-effective identification of COVID-19-positive patients. This is especially useful in developing countries, or in countries facing an increase in contagions.

Files (303.7 kB)
Name Size
303.7 kB Download
Views 1,894
Downloads 871
Data volume 264.5 MB
Unique views 1,665
Unique downloads 717


Cite as