Giter Club home page Giter Club logo

americas-football-team's Introduction

America's Football Team

A Data Science project to quantitatively determine which NFL team is America's favorite with data from Twitter.

The Python code fetches the data from Twitter, cleans it, and performs sentiment analysis on each tweet. The R code produces graphs that show which team was favored most highly at the time of the tweets capture. Data for this project was captured just before the start of the 2018 NFL draft.

Data Capture [Python]

My first step was to determine how to capture tweets and to which keywords I would look for inside a tweet. I decided to search for the team’s Twitter handle, main hashtag(s), and the team’s name spelled out in (ex. #GreenBayPackers). Once I had each of these team objects created, I queried Twitter to get a count of 10,000 tweets for each team.

Data Cleaning & Sentiment Analysis [Python]

After collecting the tweets, I cleaned the text by stripping out special characters. Then I ran the tweets thru the sentiment analysis tool called TextBlob. Each team had a data frame stored in a separate object, which eased the exporting to a CSV file.

Results [R]

Once this data was cleaned and processed, it was time to bring it into R for further analysis. Once in R, I created a sentiment mean for each team, sorted, and plotted them. As you can see in Figure 1, the Seattle Seahawks was the top performer sitting high and mighty with an average of about .2.

Unfortunately, my favorite team (the Green Bay Packers) were just coming off a hard season losing Aaron Rodgers to a season ending injury. This is my guess as to why the Packers mean sentiment analysis was so low.

Figure 1

NFL Mean Sentiment - Figure 1.

A graph of each NFL team's average sentiment analysis. A sentiment analysis ranges between -1 and 1, where -1 is a poor sentiment and 1 is a good sentiment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.