Skip to content

Instantly share code, notes, and snippets.

View garyForeman's full-sized avatar

Gary Foreman garyForeman

  • Phoenix, AZ
View GitHub Profile
from __future__ import print_function
from nltk import wordpunct_tokenize
from nltk.corpus import movie_reviews
from nltk.stem import SnowballStemmer
import re, string
import sklearn
from sklearn.feature_extraction.text import CountVectorizer, _check_stop_list
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.pipeline import Pipeline
@garyForeman
garyForeman / riddler_baseball.py
Created May 27, 2016 22:17
First Place Wins Distribution
#! /usr/bin/env python
"""
Author: Gary Foreman
Created: May 27, 2016
Solution to fivethirtyeight riddler puzzle of 5/27/16
link: http://fivethirtyeight.com/features/can-you-solve-the-puzzle-of-the-baseball-division-champs/?ex_cid=538fb
"""
import matplotlib.pyplot as plt
#! /usr/bin/env python
"""
Author: Gary Foreman
Created: December 22, 2015
Solution to riddle at
http://fivethirtyeight.com/features/how-long-will-your-smartphone-distract-you-from-family-dinner/
"""
import numpy as np
#! /usr/bin/env python
"""
Solution to exercise 3.2 of "Think Stats" by Allen B. Downey, available at
greenteapress.com
"""
from __future__ import print_function
from math import ceil
@garyForeman
garyForeman / 99bottles.arnoldc
Created July 24, 2014 21:06
Print lyrics to 99 Bottles of Beer on the Wall using ArnoldC
IT'S SHOWTIME
HEY CHRISTMAS TREE bottles
YOU SET US UP 99
HEY CHRISTMAS TREE isGreaterThan0
YOU SET US UP @NO PROBLEMO
HEY CHRISTMAS TREE isGreaterThan1
YOU SET US UP @NO PROBLEMO