This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# k-fold regression | |
# we need our modules for this: | |
from sklearn.linear_model import LinearRegression | |
from sklearn.cross_validation import cross_val_score, cross_val_predict | |
from matplotlib import pyplot as plt | |
from sklearn import metrics | |
# Make the plots bigger | |
plt.rcParams['figure.figsize'] = 10, 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns | |
import matplotlib, matplotlib.pyplot as plt | |
# initializing subplots allows changing of font size | |
fig, ax = plt.subplots() | |
fig.set_size_inches(12, 8) | |
# Change font size | |
matplotlib.rcParams.update({'font.size': 12}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class usajobs: | |
total_pages = 0 | |
total_results = 0 | |
per_page = 25 | |
verify_ssl = False | |
search_term = "" | |
mined_jobs = [] | |
headers = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
columns = ["col1", "col2", "col3", "col4"] | |
joined_columns = ") + c(".join(columns) | |
"target ~ c(" + joined_columns[0:len(joined_columns) - 1] + ")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !pip install foursquare | |
import foursquare | |
import pandas as pd | |
CLIENT_ID = '' # Input your client id/ client secret here | |
CLIENT_SECRET = '' | |
client = foursquare.Foursquare(client_id=CLIENT_ID, client_secret=CLIENT_SECRET) | |
# grab from bounding box (raw csv): http://boundingbox.klokantech.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine | |
import pandas as pd | |
class sql_logger: | |
sql_file = False | |
engine = False | |
last_game_id = 0 | |
def __init__(self, sql_file="crap.db"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
team['game_id'] = team[team['Gm#'].apply(lambda val: val.isdigit())]['Gm#'].map(int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic system updates | |
sudo apt-get update | |
sudo apt-get install python-pip | |
sudo apt-get install python-virtualenv | |
sudo apt-get install python-dev | |
# Create a directory for our virtualenvs | |
mkdir virtualenvs | |
virtualenv data | |
cd data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var newwin; | |
var tabs=[]; | |
function close_win() { | |
win = tabs.pop(); | |
win.close(); | |
} | |
jQuery( document ).ajaxComplete(function( event,request, settings ) { |