Skip to content

xengagement is a package that predicts the amount of Twitter engagement that xGPhilosophy receives with its end-of-match xG summary tweets

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

tonyelhabr/xengagement

Repository files navigation

xengagement

Lifecycle: stable

{xengagement} is a package that predicts the amount of Twitter engagement that xGPhilosophy receives with its end-of-match xG summary tweets. The predictions are shared with automated tweets made by a bot, occasionally including some manually inserted commentary 😀.

Read this Twitter thread for a high-level discussion of how the package can be used to gain insights. Also, see this dashboard using outputs from this package. (Yes, that is a python-based web app :snake: using outputs from an R package :laughing:.)

Installation

You can install the development version of {xengagement} from GitHub with:

# install.packages('remotes')
remotes::install_github('tonyelhabr/xengagement')

Developer Usage

  • data-raw/update.R: Run the Twitter bot.

  • data-raw/98_train.R: Re-train models.

  • data-raw/99_evaluate.R: Update plots used in Twitter thread.

  • data-raw/00_scrape_colors.R: Re-scrape team colors. The results have to be added manually to the team_mapping.csv file. (Not using {teamcolors} package since it may or may not be kept up-to-date.)

  • data-raw/01_generate_team_mapping.R: Update internal team mapping data sets, presumably when there are changes to EPL teams (e.g. at the beginning of a new season). Also, update team account Twitter followers (which isn’t done with transform_tweets() to prevent hitting the Twitter API a ton).

TODO

  1. Convert estimated follower counts for teams to percent ranks. (My guess is that this would slightly improve model performance.)

  2. Do a true time-based cross validation to get a better esimtate of future predictive performance.

  3. Make bot tweets more custom.

About

xengagement is a package that predicts the amount of Twitter engagement that xGPhilosophy receives with its end-of-match xG summary tweets

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages