Skip to content

Instantly share code, notes, and snippets.

View jonahwilliams's full-sized avatar

Jonah Williams jonahwilliams

View GitHub Profile
@jonahwilliams
jonahwilliams / FiftyStates.json
Last active August 29, 2015 14:17
Hispanic Voting Choropleth
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonahwilliams
jonahwilliams / CensusBlockData.json
Last active August 29, 2015 14:18
Census Block Group - Omaha Metro Area
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonahwilliams
jonahwilliams / AutoMpg.json
Last active August 29, 2015 14:18
Error Surface of a Simple Linear Regression
[{"mpg":18.0,"cylinders":8,"displacement":307.0,"horsepower":130.0,"weight":3504,"acceleration":12.0,"model_year":70,"origin":1,"car_name":"chevrolet chevelle malibu"},{"mpg":15.0,"cylinders":8,"displacement":350.0,"horsepower":165.0,"weight":3693,"acceleration":11.5,"model_year":70,"origin":1,"car_name":"buick skylark 320"},{"mpg":18.0,"cylinders":8,"displacement":318.0,"horsepower":150.0,"weight":3436,"acceleration":11.0,"model_year":70,"origin":1,"car_name":"plymouth satellite"},{"mpg":16.0,"cylinders":8,"displacement":304.0,"horsepower":150.0,"weight":3433,"acceleration":12.0,"model_year":70,"origin":1,"car_name":"amc rebel sst"},{"mpg":17.0,"cylinders":8,"displacement":302.0,"horsepower":140.0,"weight":3449,"acceleration":10.5,"model_year":70,"origin":1,"car_name":"ford torino"},{"mpg":15.0,"cylinders":8,"displacement":429.0,"horsepower":198.0,"weight":4341,"acceleration":10.0,"model_year":70,"origin":1,"car_name":"ford galaxie 500"},{"mpg":14.0,"cylinders":8,"displacement":454.0,"horsepower":220.0,"weig
@jonahwilliams
jonahwilliams / AutoMpg.json
Last active August 29, 2015 14:18
L2 Regularization
[{"mpg":18.0,"cylinders":8,"displacement":307.0,"horsepower":130.0,"weight":3504,"acceleration":12.0,"model_year":70,"origin":1,"car_name":"chevrolet chevelle malibu"},{"mpg":15.0,"cylinders":8,"displacement":350.0,"horsepower":165.0,"weight":3693,"acceleration":11.5,"model_year":70,"origin":1,"car_name":"buick skylark 320"},{"mpg":18.0,"cylinders":8,"displacement":318.0,"horsepower":150.0,"weight":3436,"acceleration":11.0,"model_year":70,"origin":1,"car_name":"plymouth satellite"},{"mpg":16.0,"cylinders":8,"displacement":304.0,"horsepower":150.0,"weight":3433,"acceleration":12.0,"model_year":70,"origin":1,"car_name":"amc rebel sst"},{"mpg":17.0,"cylinders":8,"displacement":302.0,"horsepower":140.0,"weight":3449,"acceleration":10.5,"model_year":70,"origin":1,"car_name":"ford torino"},{"mpg":15.0,"cylinders":8,"displacement":429.0,"horsepower":198.0,"weight":4341,"acceleration":10.0,"model_year":70,"origin":1,"car_name":"ford galaxie 500"},{"mpg":14.0,"cylinders":8,"displacement":454.0,"horsepower":220.0,"weig
@jonahwilliams
jonahwilliams / README.md
Last active August 29, 2015 14:18
The Boxcar Kernel

A kernel is any smooth function K such that K(x) >= 0 and $\int K(x)dx = 1$, $\int xK(x)dx = 0$, and $\theta^2_K = \int x^2K(x)dx \geq 0$.

The boxcar kernel is 0 across the domain of X, except for at a specified distance from x. We can use the boxcar kernel to take local averages for nonparametric estimation. Here the bandwidth parameter controls the specified distance. As $bandwidth \rightarrow \infty$, $K(x) \rightarrow mean(x)$.

@jonahwilliams
jonahwilliams / VotingInformationTable.tsv
Last active August 29, 2015 14:18
Interactive html Table I
Year State Total Population Total Citizen Total Registered Total Voted Hispanic Population Hispanic Citizen Hispanic Registered Hispanic Voted Percent Hispanic Population Percent Hispanic Registered Percent Hispanic Voted
2012 Alabama 3594 3479 2556 2154 107 35 12 0 2% 0% 0%
2012 Alaska 516 495 361 289 23 18 10 7 4% 2% 2%
2012 Arizona 4863 4314 2812 2412 1396 989 516 400 28% 18% 16%
2012 Arkansas 2198 2109 1376 1124 143 73 16 14 6% 1% 1%
2012 California 28357 23419 15356 13462 9935 6510 3684 3157 35% 23% 23%
2012 Colorado 3817 3544 2635 2495 681 497 284 259 17% 10% 10%
2012 Connecticut 2726 2499 1760 1568 292 220 127 103 10% 7% 6%
2012 Delaware 693 641 470 431 56 24 11 10 8% 2% 2%
2012 District Of Columbia 517 461 385 350 48 19 14 13 9% 3% 3%
@jonahwilliams
jonahwilliams / index.html
Last active August 29, 2015 14:19
Gaussian Smoother
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<style>
.axis {
font: 10px sans-serif;
}
path {
stroke: steelblue;
stroke-width: 2;
@jonahwilliams
jonahwilliams / Counties.json
Last active August 29, 2015 14:19
Kansas City Choropleth
[{"geometry": {"type": "Polygon", "coordinates": [[[-94.121361, 38.803422], [-94.121312, 38.804311], [-94.12131, 38.804344], [-94.121274, 38.80501], [-94.12121, 38.806709], [-94.121009, 38.809792], [-94.120997, 38.809981], [-94.120985, 38.810158], [-94.120948, 38.810688], [-94.120936, 38.810918], [-94.120783, 38.813753], [-94.120782, 38.813774], [-94.120766, 38.814067], [-94.120765, 38.814098], [-94.120702, 38.815578], [-94.12069, 38.815747], [-94.120679, 38.81591], [-94.120619, 38.816772], [-94.120625, 38.817495], [-94.120626, 38.81757], [-94.120626, 38.817617], [-94.120623, 38.817631], [-94.120559, 38.817887], [-94.120407, 38.818198], [-94.120354, 38.818306], [-94.120336, 38.818342], [-94.12031, 38.818469], [-94.120334, 38.818617], [-94.12034, 38.818655], [-94.120409, 38.818879], [-94.120418, 38.818967], [-94.120396, 38.819048], [-94.120312, 38.819185], [-94.120269, 38.819317], [-94.120257, 38.819422], [-94.120272, 38.819522], [-94.120312, 38.81961], [-94.12036, 38.819827], [-94.120394, 38.82027], [-94.1203
@jonahwilliams
jonahwilliams / HispanicBlockPops.json
Last active August 29, 2015 14:19
Hispanic Population of Western Nebraska
This file has been truncated, but you can view the full file.
@jonahwilliams
jonahwilliams / LinearRegression.js
Last active August 29, 2015 14:19
Regression Visual II
function LinearRegression(data){
var X = [],
y = [];
for (var i = 0; i < data.length; i ++){
var tempX = [];
for(var j = 0; j < data[0]['x'].length; j++){
tempX.push(data[i]['x'][j]);
}
X.push(tempX);
y.push([data[i].y]);