<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Predicting COVID-19 cases using Reddit posts and other online resources</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Felix Drinkall</string-name>
          <email>felix.drinkall@lmh.ox.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Janet B. Pierrehumbert</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Engineering Science, University of Oxford</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper evaluates the ability to predict COVID-19 caseloads in local areas using the text of geographically specific subreddits, in conjunction with other features. The problem is constructed as a binary classification task on whether the caseload change exceeds a threshold or not. We find that including Reddit features, alongside other informative resources, improves the models' performance in predicting COVID-19 cases. On top of this, we show that exclusive use of Reddit features can act as a strong alternative data source for predicting a short-term rise in caseload due to its strong performance and the fact that it is readily available and updates instantaneously.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        A growing literature looks into the predictive
power of social media
        <xref ref-type="bibr" rid="ref5">(Evangelos et al., 2013)</xref>
        .
This predictive power has long been applied
within quantitative finance
        <xref ref-type="bibr" rid="ref11">(Xu and Cohen, 2018)</xref>
        and has been used to detect epidemics using
the statistics of specific words associated with
illness
        <xref ref-type="bibr" rid="ref10">(Samaras et al., 2020)</xref>
        . In this paper, we
aim to use social media to predict the direction
of the COVID-19 caseload in 4 local areas of
the United States, using the state COVID-19
subreddits: Washington’s r/CoronavirusWA,
Florida’s r/FloridaCoronavirus, California’s
r/CoronavirusCA and Texas’ r/CoronaVirusTX.
Data from the US was used due to its high level
of activity on Reddit. Because the language was
dynamic during the outbreak of this previously
known virus, we did not follow
        <xref ref-type="bibr" rid="ref10">(Samaras et al.,
2020)</xref>
        in tracking keywords selected a priori,
such as ”Influenza”. Instead, we used objective
inclusion criteria to find which words were most
predictive in each location.
      </p>
      <p>To determine how well Reddit comments can
predict future COVID-19 caseloads, this paper
adopts the pipeline of Hofmann et al. (2020), a
statistical NLP study using Reddit data in a very
different application area (predicting the creation
of new complex words). The pipeline uses a
sliding window over the data stream, with each interval
serving as the training data to predict the outcome
in the subsequent window. Our model buckets
every comment on the local subreddit into a set of
daily documents F and selects a set W of
important words using the inclusion criteria outlined in
Section 2. The TF-IDF, T , of word w in the kth
document of F is calculated:</p>
      <p>Tw;F (k) = tfw;F (k)
log( jF j )
dfw
(1)</p>
      <p>Where tfw;F (k) is the number of occurrences
of w in F (k), jF j is the number of documents in
F and dfw is the number of documents that
contain w. This statistic provides a good method for
comparing how over-represented a word is in each
document. Once the TF-IDF is calculated for all of
W , we take the 7-day moving average (7-MA) of
TF-IDF. The 7-MA is used throughout this study
because of fluctuations in language usage
according to the day of the week and because the caseload
reports have artefacts from the day of the week.
This time-series data is then tabulated and
combined with other relevant datasets in Section 2 to
determine which features are important for our
prediction task.</p>
    </sec>
    <sec id="sec-2">
      <title>Datasets and Predictors</title>
      <p>The data that we seek to predict is provided by the
COVID-19 Tracking Project (CTP) 1. The current
caseload (CCL) is also considered as a predictor
for the subsequent change in caseload. Update
frequency: 24 hours. Start date: 13/01/2020</p>
      <p>The other predictors come from three sources.
Each provides data about each day, but update
speed differs. They were combined into a
time-series dataset using data up to 17/01/2020.
Days where data was incomplete were deleted.</p>
      <sec id="sec-2-1">
        <title>Oxford COVID-19 Government Response</title>
        <p>
          Tracker (OxCGRT) - The OxCGRT
          <xref ref-type="bibr" rid="ref6">(Hale et al.,
2020)</xref>
          was used to identify which government
measures were in place at each time. The data is
structured into indicators covering a wide range of
policies, including containment, health and
economic measures, as well as an overall stringency
score. Update frequency: ”continuously”, but due
to human data collection, it can be variable; daily
periodicity. Start date: 01/01/2020
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Google’s COVID-19 Community Mobility</title>
        <p>Reports (GCCMR) 2 - The GCCMR provided
movement data within different areas such as
parks, workplaces etc. The data has a high degree
of geographic specificity. The movement statistic
is relative to a benchmark taken between Jan. 3rd
and Feb. 6th 2020. Update frequency: 2-3 days.
Start date: 15/02/2020.</p>
        <p>Pushshift API - The Pushshift API from
Baumgartner et al. (2020) was used to the compile
datasets of entire target subreddits. Update
frequency: real-time. The post count P is
considered as a predictor. For each subreddit, we
also select Feature words by finding the most
over-represented words, compared to a reference
corpus R. To construct R, posts were randomly
selected from S, the Unix time stamp of each
was taken, and the following 100 posts from the
whole of Reddit were downloaded. S and R were
matched for the quantity of text at each time, as
illustrated in Figure 1. The term frequency ratio
between R and S was calculated, and the top 50
words were selected. To avoid over-reliance on
rare words, the top 50 words with the highest
term frequency in the top 1000 words in S were
added for a total of 100 candidate word features. A
chi-square test of independence was used to trim
this candidate list to the 25 feature words with the</p>
        <sec id="sec-2-2-1">
          <title>1https://covidtracking.com</title>
          <p>2https://www.google.com/covid19/mobility/
most significant relationship to the target classes,
and these were used in the prediction models.
Appendix A lists the word features that were
selected for each state. The important features
are divided amongst named entities (locations,
organisations, and people), technical terms, and
terms referring to aspects of everyday life.
The problem is presented as a classification task.
For each day the features were tagged with a binary
value that indicated whether the 7-MA of the
caseload went up by more than a certain threshold
value within the given time frame. We defined
this threshold in two different ways, relative and
absolute:
Relative change - the change is measured
as a percentage of the current value.</p>
          <p>r(t) =
(t + )
(t)
(t)
Absolute change - the change is measured as the
absolute change in the 7-MA.</p>
          <p>a(t) = (t + )
(t)
Where (t) is the 7-MA distribution of cases, and
is the time delay that refers to the time horizon of
the prediction. The relative threshold value ranges
from 10% to 100%, and the absolute threshold
ranges from 50 to 500. The predictive window
iterates from 1 to 28 days.</p>
          <p>Once the features were tagged with a binary
value, the classes were balanced by identifying
which class was larger and randomly deleting posts
until they were equal in size. This was done to
make the analysis more interpretable by making the
accuracy comparable across the different classes.
The minimum number of samples required was set
at 40, 20 examples of both classes. Then the
features were normalised, so they were all scaled
between 0 and 1. Finally, the data was passed through
the different classification models in Section 4.
4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Models</title>
      <p>
        Tree-based models were used to determine the
relative importance of the different features in
predicting the changes in caseload. The performances of
the models below were compared against a
Support Vector Machine (SVM) with a linear kernel
and a Logistic Classifier (LC) to see how the more
complex models compared to classifiers with linear
decision boundaries
        <xref ref-type="bibr" rid="ref2">(Boser et al., 1992)</xref>
        .
      </p>
      <p>
        Random Forest (RF) - The RF model
        <xref ref-type="bibr" rid="ref3">(Breiman,
2001)</xref>
        was chosen to show the viability of such a
task. The benefit of using an RF model is that
it decorrelates the different trees, which leads to
robust results. The disadvantage is that it relies on
a very dense feature set, which is problematic when
the number of features grows to a size comparable
to the number of samples.
      </p>
      <p>
        Regularised Greedy Forest (RGF) - The RGF
model
        <xref ref-type="bibr" rid="ref8">(Johnson and Zhang, 2014)</xref>
        was chosen due
to the added robustness from the fully-corrective
regularized greedy search that learns the decision
forests. This results in a sparse feature set by
adopting L1 and L2 regularisation. We have compared
this to an XGBoost model to deliver the best
regularised model
        <xref ref-type="bibr" rid="ref4">(Chen and Guestrin, 2016)</xref>
        . This
model also uses L1 and L2 regularisation to prevent
overfitting.
5
      </p>
    </sec>
    <sec id="sec-4">
      <title>Results</title>
      <p>Each data source in Section 2 is used by itself to
perform the classification task and then combined
together to compare the performance across the
different data sources. The default subreddit used
below is Washington’s r/CoronavirusWA since it
has the largest subreddit by comment number.</p>
      <p>Models (average) 7 days</p>
      <p>RF (.828) .805
SVM (.814) .766
LC (.814) .768</p>
      <p>RGF (.807) .766
XGBOOST (.785) .753</p>
      <p>Despite having more sparse feature sets, neither
the RGF nor XGBOOST models outperform the
RF model. The SVM and LC models perform very
well; however, an RF model is used for the
following analysis because of its high performance
and because the Gini feature importances used
in sklearn.ensemble.RandomForestClassifier are
highly interpretable. The time delay that delivers
the most precise results for each feature is tabulated
in Table 2. In Table 2 the RF model is trained only
using the data from each of the data sources in the
Data Source column.</p>
      <p>Table 2 shows that for the majority of data
sources, a 14 days prediction horizon yields the
best results. Below, a delay of 14 days is used to
compare the difference in performance using
different thresholds. It also shows that Tw performs very
well as a single feature class but that there is an
improvement when all data sources are included.</p>
      <p>Table 3 breaks down the performance across
different thresholds for the increase. As found in
many other studies, more extreme events are easier
to predict. The highest performance, apart from
using all the data sources, is found when only word
features were used. These aspects of the
performance are consistent across both the relative and
absolute thresholds.</p>
      <p>Feature importance - The importance of
feature type in the RF model is tabulated in Table 4.</p>
      <p>The individual feature importances were added up
by category. Clearly, the word features constitute
the most important feature type in the prediction.
This section compares the performance in multiple
states to see that these results are not unique for
r/CoronavirusWA and that the framework is
applicable within multiple regions. For this analysis,
state subreddits that were comparable in size, and
were culturally different from one another were
erally more significant for larger subreddits. The
used. The list of subreddits is shown in Table 5.</p>
      <p>State</p>
      <p>Subreddit
Washington r/CoronavirusWA
California r/CoronavirusCA</p>
      <p>Texas r/CoronaVirusTX
Florida r/FloridaCoronavirus</p>
      <p>Start date
and CCL are combined and compared against the
N R features generally outperform the Tw features;
however, this is not surprising since the M and G
feature sets provide high-quality complementary
information that should result in a higher
performance than using each feature set in isolation; the
M features show whether the government
restrictions outlined by the G features are being listened
to. The fact that there is a performance
improvement when using all of the features shows that the
Reddit data provides further information that is not
captured in the N R features. Reddit data provides
an insight into what people are talking and thinking
about, which could cause people to not listen to the
government restrictions.</p>
      <p>
        Using only Tw yields very good results at a
7day prediction horizon relative to other variable
sources. COVID-19 has an incubation period of
performance using all features, and the Reddit
fea5-6 days
        <xref ref-type="bibr" rid="ref12">(Yu et al., 2020)</xref>
        , it also takes a between
tures alone. It shows that there is an improvement
24-48 hours to get a PCR test result
        <xref ref-type="bibr" rid="ref9">(Larremore
in performance across all time periods when using
et al., 2021)</xref>
        . This high relative performance at a
Reddit data alongside other data sources. The
im7-day time delay suggests that the language on
Redprovement that the subreddit data provides is
gendit indicates whether the population is contracting
Washington
California
      </p>
      <p>Texas
Florida
Average</p>
      <p>All
.805
.765
.807
.850
.807</p>
      <p>N R
.783
.722
.781
.851
.784
7 days
relative threshold values. N R - all data sources other than the subreddit data; Tw - as above; Diff. = All - N R
the disease more rapidly than other data sources do.</p>
      <p>That is, Reddit provides a strong live indicator of
the experience and concerns in the population at
any given time. In conjunction with real-time
update frequency referenced in Section 2, this makes
the use of subreddit data very convincing.
6</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>It is clear that the content of a local subreddit is
a valuable data source for predicting the
COVID19 caseload in specific regions. The Tw features
provided the best single feature set in almost all
experimental setups, as seen in Table 3. When
combined with the comparison feature sets in Table 6,
the Tw features provided complementary
information that resulted in a performance improvement.
The results in Washington were also reproduced
in other states, highlighting the robustness of the
method used. A further advantage is that subreddit
data is readily available. As is shown in Section 2,
many of the other data sources take hours/days to
update, and some only exist because the world is in
a pandemic, as is the case with the GCCMR data.</p>
      <p>There is also scope for future development
using other machine learning techniques. In
particular, using contextualised word embeddings has
the potential to exploit the semantic relationships
between words that are not well captured by a
Bagof-Words approach.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgements</title>
      <p>This work was supported in part by a grant from
the Engineering and Physical Sciences Research
Council (EP/T023333/1).</p>
      <p>XgCoRR,
A.1</p>
      <sec id="sec-6-1">
        <title>Feature words</title>
        <sec id="sec-6-1-1">
          <title>State</title>
        </sec>
        <sec id="sec-6-1-2">
          <title>Washington</title>
        </sec>
        <sec id="sec-6-1-3">
          <title>California</title>
        </sec>
        <sec id="sec-6-1-4">
          <title>Texas</title>
        </sec>
        <sec id="sec-6-1-5">
          <title>Florida</title>
          <p>’bothell’, ’kirkland’, ’omak’, ’oroville’, ’seatac’, ’skagit’, ’snohomish’,
’spokane’, ’thurston’
People ’bedford’, ’culp’, ’inslee’
Organisations ’esd’, ’peuc’
Technical ’7day’, ’coronavirus’, ’health’, ’sick’, ’virus’
Other ’adjudication’, ’business’, ’news’, ’open’, ’places’, ’social’
Locations ’alameda’, ’huntington’, ’merced’, ’modesto’, ’monterey’, ’norcal’,
’solano’, ’sonoma’, ’stanislaus’, ’stockton’
People ’garcetti’
Organisations ’ihme’
Technical ’cases’, ’comorbidities’, ’sick’
Other ’aerosols’, ’californian’, ’californians’, ’certain’, ’city’, ’defying’,
’school’, ’shelterinplace’, ’state’, ’states’
’abilene’, ’brazoria’, ’christi’, ’galveston’, ’houston’, ’frisco’, ’nueces’</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <given-names>Jason</given-names>
            <surname>Baumgartner</surname>
          </string-name>
          , Savvas Zannettou, Brian Keegan, Megan Squire, and
          <string-name>
            <given-names>Jeremy</given-names>
            <surname>Blackburn</surname>
          </string-name>
          .
          <year>2020</year>
          .
          <article-title>The pushshift reddit dataset</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <given-names>Bernhard E.</given-names>
            <surname>Boser</surname>
          </string-name>
          ,
          <string-name>
            <surname>Isabelle M. Guyon</surname>
          </string-name>
          , and
          <string-name>
            <surname>Vladimir</surname>
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Vapnik</surname>
          </string-name>
          .
          <year>1992</year>
          .
          <article-title>A training algorithm for optimal margin classifiers</article-title>
          .
          <source>In Proceedings of the Fifth Annual Workshop on Computational Learning Theory, COLT '92, page 144-152</source>
          , New York, NY, USA. Association for Computing Machinery.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <given-names>Leo</given-names>
            <surname>Breiman</surname>
          </string-name>
          .
          <year>2001</year>
          .
          <article-title>Random forests</article-title>
          .
          <source>Machine Learning</source>
          ,
          <volume>45</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <given-names>Tianqi</given-names>
            <surname>Chen</surname>
          </string-name>
          and
          <string-name>
            <given-names>Carlos</given-names>
            <surname>Guestrin</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>boost: A scalable tree boosting system</article-title>
          .
          <source>abs/1603</source>
          .02754.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <given-names>Kalampokis</given-names>
            <surname>Evangelos</surname>
          </string-name>
          , Tambouris Efthimios, and
          <string-name>
            <given-names>Tarabanis</given-names>
            <surname>Konstantinos</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Understanding the predictive power of social media</article-title>
          .
          <source>Internet Research</source>
          ,
          <volume>23</volume>
          , No.
          <volume>5</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <given-names>Thomas</given-names>
            <surname>Hale</surname>
          </string-name>
          , Sam Webster, Anna Petheric, Toby Phillips, and
          <string-name>
            <given-names>Beatriz</given-names>
            <surname>Kira</surname>
          </string-name>
          .
          <year>2020</year>
          .
          <article-title>Oxford covid-19 government response tracker</article-title>
          .
          <source>Blavatnik School of Government.</source>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <given-names>Valentin</given-names>
            <surname>Hofmann</surname>
          </string-name>
          , Janet Pierrehumbert, and Hinrich Schu¨tze.
          <year>2020</year>
          .
          <article-title>Predicting the growth of morphological families from social and linguistic factors</article-title>
          .
          <source>In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics</source>
          , pages
          <fpage>7273</fpage>
          -
          <lpage>7283</lpage>
          , Online. Association for Computational Linguistics.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <given-names>Rie</given-names>
            <surname>Johnson</surname>
          </string-name>
          and Tong Zhang.
          <year>2014</year>
          .
          <article-title>Learning nonlinear functions using regularized greedy forest</article-title>
          .
          <source>IEEE Transactions on Pattern Analysis and Machine Intelligence</source>
          ,
          <volume>36</volume>
          (
          <issue>5</issue>
          ):
          <fpage>942</fpage>
          -
          <lpage>954</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Daniel B. Larremore</surname>
          </string-name>
          , Bryan Wilder, Evan Lester, Soraya Shehata,
          <string-name>
            <surname>James M. Burke</surname>
          </string-name>
          , James A.
          <string-name>
            <surname>Hay</surname>
            , Milind Tambe,
            <given-names>Michale J.</given-names>
          </string-name>
          <string-name>
            <surname>Mina</surname>
            , and
            <given-names>Roy</given-names>
          </string-name>
          <string-name>
            <surname>Parker</surname>
          </string-name>
          .
          <year>2021</year>
          .
          <article-title>Test sensitivity is secondary to frequency and turnaround time for covid-19 screening</article-title>
          .
          <source>Science advances.</source>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <given-names>Loukas</given-names>
            <surname>Samaras</surname>
          </string-name>
          , Elena Garc´
          <article-title>ıa-</article-title>
          <string-name>
            <surname>Barriocanal</surname>
          </string-name>
          , and
          <string-name>
            <surname>Miguel-Angel Sicilia</surname>
          </string-name>
          .
          <year>2020</year>
          .
          <article-title>Comparing social media and google to detect and predict severe epidemics</article-title>
          .
          <source>Nature - Sci Rep</source>
          <volume>10</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <given-names>Yumo</given-names>
            <surname>Xu</surname>
          </string-name>
          and
          <string-name>
            <given-names>Shay B.</given-names>
            <surname>Cohen</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Stock movement prediction from tweets and historical prices</article-title>
          .
          <source>Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics.</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <given-names>Ping</given-names>
            <surname>Yu</surname>
          </string-name>
          , Jiang Zhu, Zhengdong Zhang, and Yingjun Han.
          <year>2020</year>
          .
          <article-title>A familial cluster of infection associated with the 2019 novel coronavirus indicating possible person-to-person transmission during the incubation period</article-title>
          .
          <source>J Infect Dis.</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>