How to Win At Jeopardy: An Interactive Look at Jeopardys Most Common Subjects

Author

Student

Introduction

This report uses the same Jeopardy! category and clue data as Portfolio 3. Using about 20,000 clues across roughly 3,580 categories we again seek to answer the same question: what should you actually study to do well on the show? However, while Portfolio 3 answered it with static charts, this version rebuilds the analysis with a variety of interactive components instead.

Code
library(tidyverse)
library(tidytext)
library(shiny)
library(rsconnect)
library(DT)
library(plotly)

#raw data set
jeopardy <- read_csv("data/jeopardy.csv", 
                     col_types = cols(
                       `Show Number` = col_double(),
                       `Air Date` = col_character(),
                       Round = col_character(),
                       Category = col_character(),
                       Value = col_character(),
                       Question = col_character(),
                       Answer = col_character()
                     )
) 

Interactive Data-Table (With DT)

Code
#counts words in categories
word_count_category <- jeopardy %>% 
  distinct(Category) %>% 
  unnest_tokens(word, Category) %>% 
  anti_join(stop_words, by = "word") %>% 
  count(word, name = "n_category", sort = TRUE)

#counts words in questions
word_count_question <- jeopardy %>% 
  mutate(question_clean = str_remove_all(Question, "<[^>]+>"), #removes all text between < >
         question_clean = str_remove_all(question_clean, "https?://\\S+")) |> #strips url
  unnest_tokens(word, question_clean) %>% 
  anti_join(stop_words, by = "word") %>% 
  filter(!str_detect(word, "^[0-9]+$")) %>% #remove numbers
  count(word, sort = TRUE, name = "n_question")

#join question count dataset and category count dataset
word_count <- full_join(word_count_category, word_count_question, by = "word") %>% 
mutate(n_category = replace_na(n_category, 0),
        n_question = replace_na(n_question, 0),
        n_total = n_question + n_category)

#interactive datable of word counts
word_count_dt <- word_count %>% 
  select(word, category_occurrences = n_category,
         clue_occurrences = n_question, total_occurences = n_total) %>% 
  datatable(
    filter = "top",
    colnames = c("Word", "Category occurrences", "Clue occurrences", "Total occurences"),
    rownames = FALSE
  )

word_count_dt

Top Ten Most Common Words in Jeopardy Categories (Plotly Interactive Graph)

Code
#slice top ten most common words in categories
top_words <- word_count %>% 
  slice_max(n_category, n = 10) 

#pot code
p <- ggplot(top_words, aes(x = n_category, y = reorder(word, n_category),
                               text = paste0("word: ", word, "<br>occurrences: ", n_category))) +
      geom_col(fill = "#7D7098") +
      labs(
        title = "Top 10 Most Common Words in Jeopardy Categories",
        x = "Occurrences", y = NULL
      ) +
      theme_minimal(base_size = 13) + 
      theme(plot.title = element_text(color = "#33363b"))
    
    ggplotly(p, tooltip = "text")

Why This Interactivity

Portfolio 3 (How to Win Jeopardy: A Data-Driven Guide to Studying for America’s Favorite Gameshow) aimed to answer the question “what should I study if I want to win at Jeopardy?” using a static bar chart of the top category words and a word cloud of clue text. These visualizations were effective for spotting broad themes, but neither one offered the tools to dig deeper and see an exact count or look up anything outside the handful of words at the top of the list. In this project, I replaced the bar chart with an interactive plotly version that shows the exact number of category and clue occurrences on hover, and added a searchable, sortable DT table covering every word in the data set rather than just the top ten or fifteen. In combination, these change the project from “here’s what we found” to something closer to an actual study tool. Allowing a reader to search for any word they’re curious about and immediately see how often it shows up in category titles and clue text.

A companion Shiny app takes these tools even further, letting a reader adjust the graph itself to cover specific rounds and date ranges or type in any word to get a live count rather than searching the table.

https://ilthnb-dashiell-brenner.shinyapps.io/portfolio4-brennerd/.