I'm at JITP's conference on the future of computational social science this week. Really interesting gathering of social scientists (and a smattering of CS people) interested in computational social science. I'll blog more thoughts on the conference once it's over (tonight).
For now, I'll post the resource I already have put together: my conference slides.
Politics, lifehacking, data mining, and a dash of the scientific method from an up-and-coming policy wonk.
Showing posts with label sampling. Show all posts
Showing posts with label sampling. Show all posts
Tuesday, May 17, 2011
Thursday, May 5, 2011
Working paper: An automated snowball census of the political web
Here's my paper for the JITP Future of Computational Social Science conference in a couple weeks. This paper describes my process for using SnowCrawl and a highly trained text classifier to search out political web sites -- pretty much all of them -- on the web.
Final census results are available here. I'm planning to run another iteration of this census before too long. I welcome comments and suggestions.
Final census results are available here. I'm planning to run another iteration of this census before too long. I welcome comments and suggestions.
Tuesday, April 19, 2011
Code: a random web crawler
This code crawls the web to generate a pseudo-random sample of web sites. Not my prettiest code, but it works and may save somebody an afternoon of coding.
random_crawler.tar.gz (14MB, zipped)
random_crawler.tar.gz (14MB, zipped)
This script explores the web for a pseudo-random sample of sites. The crawl proceeds in a series of 100 (by default) waves. In each wave, 2,000 (by default) crawlers attempt to download pages. When page downloads are successful, all the unique outbound hyperlinks are stored to a master list. Then sites for the next round are sampled.
Sites from common domain names are undersampled, to avoid getting stuck (e.g. within specific social networking sites). When sites are selected for the next round, weights are equal x^(3/4), where x is the number of sites in the same domain.
After several waves, the sample should be well-mixed -- a pseudo-random sample of the web.
Note: This code is kind of sloppy, does not scale well, and is poorly commented. Bad code! Bad!
Subscribe to:
Posts (Atom)