GitXplorerGitXplorer
k

homophily_monophily_NHB

public
9 stars
3 forks
0 issues

Commits

List of commits on branch master.
Unverified
ef7c297694885e1bf1e1e4cc75a6ba9bd3d83164

update

committed 7 years ago
Unverified
0822d14d83e1a17f5a72c486f27e48034856c768

update

committed 7 years ago
Unverified
eca1196f7c1253c76dfce4e540624c913f6172e6

update

committed 7 years ago
Unverified
b8c86ab673b02ca3b0cb1560e41890168acda899

update

committed 7 years ago
Unverified
835c39fc716b624e5bae7178528a244663a2cfbf

update

committed 7 years ago
Unverified
bd5d83de8a76a362aa7995da25a50af6781a42e2

update

committed 7 years ago

README

The README file for this repository.

Replication code: "Monophily in social networks introduces similarity among friends-of-friends"

Documentation

This repository contains all the correponding code to replicate the figures in "Monophily in social networks introduces similarity among friends-of-friends". We provide links to the datasets (Facebook100, AddHealth, Political Blogs, and Noordin Top) in the data sub-folder.

Directions

This repository set-up assumes that the FB100 (raw .mat files) and Add Health datasets have been acquired and are saved the data/original folder. Here are the directions:

  1. Save raw files in data/original

  2. Update global file-paths in 'functions/define_paths.py' to your local directory settings.

  3. Run code which is briefly described below:

    • 0_oSBM/ - includes notebooks for code related to simulations of oSBM graphs.
    • 1_analyze_FB100_AddHealth_Noordin_PolBlogs/ - includes all relevant code for data analysis presented in main paper and SI.
    • functions/compare_*.py - scripts for creating k-hop figures (AUC or proportion same).

All random number generators used in the analysis have been seeded deterministically to produce persistent cross-validation folds and thereby consistent results when re-running the analysis. The code for generating random graphs (sampled from the overdispersed stochastic block model) is not deterministically seeded. All code was written and tested for Python 2.7.12 with versions for the following main Python libraries: networkx (1.9.1), numpy (1.13.3), pandas (0.20.3), rpy2 (2.8.5), sklearn (0.18.1), matplotlib(1.5.1), openpyxl (2.5.0), and xlrd (1.1.0). The code has know incompatibilities with Python 3.x and with networkx 2.x.

Authors