├── README.md ├── 3flips.png ├── cancergraph.png ├── .gitignore ├── predictwise.csv ├── babyboom.dat.txt └── g12.csv /README.md: -------------------------------------------------------------------------------- 1 | # 2015Lab3 2 | -------------------------------------------------------------------------------- /3flips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs109/2015lab3/master/3flips.png -------------------------------------------------------------------------------- /cancergraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cs109/2015lab3/master/cancergraph.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | 59 | #Ipython 60 | .ipynb_checkpoints/ 61 | # Created by .ignore support plugin (hsz.mobi) 62 | ### OSX template 63 | .DS_Store 64 | .AppleDouble 65 | .LSOverride 66 | 67 | # Icon must end with two \r 68 | Icon 69 | 70 | # Thumbnails 71 | ._* 72 | 73 | # Files that might appear in the root of a volume 74 | .DocumentRevisions-V100 75 | .fseventsd 76 | .Spotlight-V100 77 | .TemporaryItems 78 | .Trashes 79 | .VolumeIcon.icns 80 | 81 | # Directories potentially created on remote AFP share 82 | .AppleDB 83 | .AppleDesktop 84 | Network Trash Folder 85 | Temporary Items 86 | .apdisk 87 | 88 | #Temporary data 89 | tempdata/ 90 | -------------------------------------------------------------------------------- /predictwise.csv: -------------------------------------------------------------------------------- 1 | Obama,Romney,States,Votes 2 | 0.0,1.0,Alabama,9 3 | 0.0,1.0,Alaska,3 4 | 0.062,0.938,Arizona,11 5 | 0.0,1.0,Arkansas,6 6 | 1.0,0.0,California,55 7 | 0.807,0.193,Colorado,9 8 | 1.0,0.0,Connecticut,7 9 | 1.0,0.0,Delaware,3 10 | 1.0,0.0,District of Columbia,3 11 | 0.72,0.28,Florida,29 12 | 0.004,0.996,Georgia,16 13 | 1.0,0.0,Hawaii,4 14 | 0.0,1.0,Idaho,4 15 | 1.0,0.0,Illinois,20 16 | 0.036000000000000004,0.9640000000000001,Indiana,11 17 | 0.8370000000000001,0.163,Iowa,6 18 | 0.0,1.0,Kansas,6 19 | 0.0,1.0,Kentucky,8 20 | 0.0,1.0,Louisiana,8 21 | 1.0,0.0,Maine,4 22 | 1.0,0.0,Maryland,10 23 | 1.0,0.0,Massachusetts,11 24 | 0.987,0.013000000000000001,Michigan,16 25 | 0.982,0.018000000000000002,Minnesota,10 26 | 0.0,1.0,Mississippi,6 27 | 0.07400000000000001,0.9259999999999999,Missouri,10 28 | 0.046,0.9540000000000001,Montana,3 29 | 0.0,1.0,Nebraska,5 30 | 0.851,0.149,Nevada,6 31 | 0.857,0.14300000000000002,New Hampshire,4 32 | 0.998,0.002,New Jersey,14 33 | 0.985,0.015,New Mexico,5 34 | 1.0,0.0,New York,29 35 | 0.349,0.6509999999999999,North Carolina,15 36 | 0.025,0.975,North Dakota,3 37 | 0.89,0.11,Ohio,18 38 | 0.0,1.0,Oklahoma,7 39 | 0.976,0.024,Oregon,7 40 | 0.978,0.022000000000000002,Pennsylvania,20 41 | 1.0,0.0,Rhode Island,4 42 | 0.0,1.0,South Carolina,9 43 | 0.001,0.9990000000000001,South Dakota,3 44 | 0.001,0.9990000000000001,Tennessee,11 45 | 0.0,1.0,Texas,38 46 | 0.0,1.0,Utah,6 47 | 1.0,0.0,Vermont,3 48 | 0.7979999999999999,0.20199999999999999,Virginia,13 49 | 0.9990000000000001,0.001,Washington,12 50 | 0.002,0.998,West Virginia,5 51 | 0.925,0.075,Wisconsin,10 52 | 0.0,1.0,Wyoming,3 53 | -------------------------------------------------------------------------------- /babyboom.dat.txt: -------------------------------------------------------------------------------- 1 | 0005 1 3837 5 2 | 0104 1 3334 64 3 | 0118 2 3554 78 4 | 0155 2 3838 115 5 | 0257 2 3625 177 6 | 0405 1 2208 245 7 | 0407 1 1745 247 8 | 0422 2 2846 262 9 | 0431 2 3166 271 10 | 0708 2 3520 428 11 | 0735 2 3380 455 12 | 0812 2 3294 492 13 | 0814 1 2576 494 14 | 0909 1 3208 549 15 | 1035 2 3521 635 16 | 1049 1 3746 649 17 | 1053 1 3523 653 18 | 1133 2 2902 693 19 | 1209 2 2635 729 20 | 1256 2 3920 776 21 | 1305 2 3690 785 22 | 1406 1 3430 846 23 | 1407 1 3480 847 24 | 1433 1 3116 873 25 | 1446 1 3428 886 26 | 1514 2 3783 914 27 | 1631 2 3345 991 28 | 1657 2 3034 1017 29 | 1742 1 2184 1062 30 | 1807 2 3300 1087 31 | 1825 1 2383 1105 32 | 1854 2 3428 1134 33 | 1909 2 4162 1149 34 | 1947 2 3630 1187 35 | 1949 2 3406 1189 36 | 1951 2 3402 1191 37 | 2010 1 3500 1210 38 | 2037 2 3736 1237 39 | 2051 2 3370 1251 40 | 2104 2 2121 1264 41 | 2123 2 3150 1283 42 | 2217 1 3866 1337 43 | 2327 1 3542 1407 44 | 2355 1 3278 1435 45 | -------------------------------------------------------------------------------- /g12.csv: -------------------------------------------------------------------------------- 1 | State,Democrat,Republican,Dem_Adv,N 2 | Alabama,36.0,49.6,-13.6,3197 3 | Alaska,35.9,44.3,-8.4,402 4 | Arizona,39.8,47.3,-7.5,4325 5 | Arkansas,41.5,40.8,0.7,2071 6 | California,48.3,34.6,13.7,16197 7 | Colorado,39.9,45.1,-5.2,3671 8 | Connecticut,49.8,34.4,15.4,2020 9 | Delaware,50.5,33.1,17.4,540 10 | District of Columbia,79.0,12.7,66.3,416 11 | Florida,43.0,42.3,0.7,9965 12 | Georgia,40.3,44.3,-4.0,5110 13 | Hawaii,54.3,28.7,25.6,466 14 | Idaho,27.5,57.8,-30.3,1336 15 | Illinois,48.4,35.8,12.6,5888 16 | Indiana,39.0,45.7,-6.7,4197 17 | Iowa,43.2,41.4,1.8,2337 18 | Kansas,34.4,51.3,-16.9,1937 19 | Kentucky,43.5,43.1,0.4,2898 20 | Louisiana,40.3,45.1,-4.8,2655 21 | Maine,43.8,39.4,4.4,1040 22 | Maryland,54.0,33.8,20.2,3571 23 | Massachusetts,52.5,33.4,19.1,3583 24 | Michigan,47.7,36.6,11.1,5056 25 | Minnesota,48.4,38.2,10.2,3873 26 | Mississippi,40.1,47.1,-7.0,1763 27 | Missouri,40.1,44.0,-3.9,3727 28 | Montana,35.9,49.6,-13.7,1137 29 | Nebraska,33.1,52.1,-19.0,1351 30 | Nevada,39.2,43.4,-4.2,1348 31 | New Hampshire,42.3,43.8,-1.5,873 32 | New Jersey,47.4,35.9,11.5,4239 33 | New Mexico,44.7,41.1,3.6,1555 34 | New York,52.0,30.8,21.2,8674 35 | North Carolina,43.4,43.2,0.2,6213 36 | North Dakota,35.8,49.0,-13.2,547 37 | Ohio,44.1,40.5,3.6,6426 38 | Oklahoma,38.6,48.0,-9.4,2583 39 | Oregon,47.2,39.1,8.1,3002 40 | Pennsylvania,46.4,41.2,5.2,8443 41 | Rhode Island,52.5,26.5,26.0,623 42 | South Carolina,36.9,48.8,-11.9,2858 43 | South Dakota,41.5,47.5,-6.0,607 44 | Tennessee,38.1,46.5,-8.4,4231 45 | Texas,38.3,44.1,-5.8,11325 46 | Utah,24.5,63.8,-39.3,2256 47 | Vermont,48.8,34.9,13.9,550 48 | Virginia,41.2,44.2,-3.0,5313 49 | Washington,47.5,37.7,9.8,5333 50 | West Virginia,45.3,41.9,3.4,1202 51 | Wisconsin,45.0,42.2,2.8,4140 52 | Wyoming,26.7,56.6,-29.9,600 53 | --------------------------------------------------------------------------------