I am working through Pattern Recognition and Machine Learning by Christopher Bishop and made these graphs of the least squared error solution to various polynomial fitting problems.
Tuesday, September 10, 2013
Classification of whether a county has AP Calculus (Part 1)
I used python's Numpy to get some information about how employment, creative jobs, arts jobs, and the ratio of creative jobs and arts jobs to employment influence whether a county has AP Calculus offered within its borders.
The data was called Creative Class County Codes at Data.gov. I used the same zip codes from the earlier project and converted them to counties by downloading a spreadsheet from UnitedStatesZipCodes.org. The code follows:
The data was called Creative Class County Codes at Data.gov. I used the same zip codes from the earlier project and converted them to counties by downloading a spreadsheet from UnitedStatesZipCodes.org. The code follows:
Labels:
AP Calculus,
logistic cost function,
Python,
Richard Florida
Friday, July 19, 2013
How Kafkaesque was the Supreme Court during their 2012 term?
Labels:
Dendrogram,
Kafka,
Phylogenetic Tree,
R,
Supreme Court Decisions
Thursday, July 18, 2013
Supreme Court 2012 Term Opinion Word Frequency Analysis
The first thing that stuck out was the 'u' which might be more common in a future century when the Supreme Court decisions are texted out. Here it is because I split the text into words on anything that wasn't a letter(lower case or upper case) or an apostrophe. So the 'u', 's', and 'v' are 'U. S. v.' text strings that have been split up on the white space and periods.
Wednesday, July 17, 2013
Word frequency analysis of Kafka's Metamorphosis
Tuesday, June 11, 2013
Pretty Choropleth using ggplot in R
I think it's a pretty interesting graph. I got the data from the Minnesota Department of Health Website.
Monday, June 10, 2013
First time using ggplot2 in R
I used the packages XML, rgdal, maptools, and ggplot2. From XML I used readHTMLTable and got a bunch of tables from the Star Tribune 100 website. I was able to get the cities from the tables and then I used the census 2010 cities shapefile and subsetted severely by whether the city was in Minnesota and had the same name as a city from the Star Tribune 100.
I now have the points of the cities and the outline of the state of Minnesota. Next came the hard part. I don't know a ton about Geographical Information Systems or much about Geography so I couldn't tell what coordinate system my two layers were in. After much stumbling around I realized that the cities were in longitude and latitude and that the outline of the state of Minnesota was in something called UTM. So I used spTransform from rgdal to change coordinate systems from UTM zone 15 to longitude/latitude. After that I plotted using ggplot2 and it seems to work out.
The three dots that seem like they could be artifacts or something are probably Montevideo, Fergus Falls, and Thief River Falls.
I now have the points of the cities and the outline of the state of Minnesota. Next came the hard part. I don't know a ton about Geographical Information Systems or much about Geography so I couldn't tell what coordinate system my two layers were in. After much stumbling around I realized that the cities were in longitude and latitude and that the outline of the state of Minnesota was in something called UTM. So I used spTransform from rgdal to change coordinate systems from UTM zone 15 to longitude/latitude. After that I plotted using ggplot2 and it seems to work out.
The three dots that seem like they could be artifacts or something are probably Montevideo, Fergus Falls, and Thief River Falls.
Labels:
Choropleth,
R,
Star Tribune,
Star Tribune 100,
Web Scraping
Subscribe to:
Posts (Atom)









