# Wolfram Language™

Open live version

## Visualize Celebrity Gossip

Make networks of celebrity popularity and connections based on analyses of Wikipedia page traffic.

X
X
X
X
X
X
X
X
X
X
X

### how it works

Anyone even a tiny bit savvy in celebrity gossip would group together Angelina Jolie and Brad Pitt because of family relationships and the film they made together. This grouping can be deduced by applying statistics and graph theory to data on visits to the Wikipedia pages of the celebrities in question. If visits to one celebritys web page are correlated with visits to anothers, you can infer that there is a connection between them in the public mind.

Here is a list of actors and actresses:

In[1]:=
X

Their portraits can be pulled from Wolfram|Alpha. Use ParallelMap to take full advantage of multiple cores in your computer to speed things up:

In[2]:=
X

Heres a gallery of the celebrities were dealing with:

In[3]:=
X
Out[3]=

This function retrieves time series data on how often a given celebritys Wikipedia page is visited per day:

In[4]:=
X

Use that function to get page-hit data for all of the celebrities in the list. Again, using ParallelMap will speed things up if you are working on a multi-core machine:

In[5]:=
X

Compute the Pearsons cross-correlation coefficient between all pairs of celebrities. The result is a matrix whose {i, j} entry is the correlation between celebrities i and j:

In[6]:=
X

Visualize the correlation with a heat map where red indicates a strong connection and green a weak one:

In[7]:=
X
Out[7]=

To make a network of celebrity connections, first prepare a weighted adjacency matrix.

A Pearsons correlation coefficient higher than 0.4 indicates a strong positive relationship. Assume no connection for values lower than that. Replace 0 values, and 1 values resulting from self-correlation, by infinitya convention for absent edges in weighted adjacency matrices.

In[8]:=
X

Make a network from the matrix, assigning vertex sizes by relative popularity, as indicated by the total number of Wikipedia page visits:

In[9]:=
X
In[10]:=
X
Out[10]=

Gain more insight into who groups with whom by making a network of communities within that network:

In[11]:=
X
Out[11]=