Analyzing friendships with statistics

statistics data-analysis python

Using jaccard similarity to check the probability of speaking in the same 5 minute interval as another person, you can infer how close of a relationship they share.

I analyzed a few years worth of discord messages to do just this.

Link to the code (github)

Tools used:

  • DiscordChatExporter
  • Python (numpy, pandas, networkx, matplotlib puplot and animation)
  • john doe
    • my own library that implements dockers random name generation
    • used to anonymize names

How to use

  1. install discordchatexporter
  2. export messages to messages.csv
  3. install dependencies
  4. run the test.ipynb notebook

How it works

  • split all messages in 5 minute intervals
  • use jaccard similarity (intersection/union) to determine if you usually speak in the same interval
  • if you’re repeatedly seen in the same interval as someone else, you’re moved closer to him in the graph
  • a pattern naturally forms, which shows how close people are to eachother