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
info: Creating snapshot 0.0.0-12 | |
info Uploading: [============================ ] 98% | |
info: Updating app movie-match | |
info: Activating snapshot 0.0.0-12 for movie-match | |
info: Starting app movie-match | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
error: There was an error while attempting to deploy the app | |
error: | |
error: Rackspace Error (404): Item not found |
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
info: Creating snapshot 0.0.0-15 | |
info Uploading: [=============================] 99% | |
info: Updating app movie-match | |
info: Activating snapshot 0.0.0-15 for movie-match | |
info: Starting app movie-match | |
error: Error running command deploy | |
error: socket hang up | |
info: | |
jitsu's client request timed out before the server could respond | |
info: This error may be due to network connection problems |
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 numpy as np | |
import pylab as pl | |
import pandas as pd | |
from sklearn import svm | |
from sklearn import linear_model | |
from sklearn import tree | |
from sklearn.metrics import confusion_matrix |
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
o o o | |
o x | |
o x x x | |
x o | |
x x x o | |
x | |
o o | |
o | |
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 sklearn.cluster import AffinityPropagation, KMeans, MiniBatchKMeans | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
import odcdata | |
import pprint as pp | |
q = "select UPPER(description) as description from odc_bank_transaction limit 1000" | |
data = odcdata.read_gp_as_dict(q) | |
descriptions = [row['description'] for row in data] | |
tfidf = TfidfVectorizer() |
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
library(sqldf) | |
sqldf("SELECT | |
day | |
, avg(temp) as avg_temp | |
FROM beaver2 | |
GROUP BY | |
day;") | |
# day avg_temp |
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
library(plyr) | |
# split a data frame by Species, summarize it, then convert the results | |
# into a data frame | |
ddply(iris, .(Species), summarise, | |
mean_petal_length=mean(Petal.Length) | |
) | |
# Species mean_petal_length | |
#1 setosa 1.462 | |
#2 versicolor 4.260 |
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
library(stringr) | |
names(iris) | |
#[1] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species" | |
names(iris) <- str_replace_all(names(iris), "[.]", "_") | |
names(iris) | |
#[1] "Sepal_Length" "Sepal_Width" "Petal_Length" "Petal_Width" "Species" | |
s <- c("Go to Heaven for the climate, Hell for the company.") | |
str_extract_all(s, "[H][a-z]+ ") |
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
library(RPostgreSQL) | |
drv <- dbDriver("PostgreSQL") | |
db <- dbConnect(drv, dbname="ncaa", | |
user="YOUR USER NAME", password="YOUR PASSWORD") | |
q <- "SELECT | |
* | |
FROM | |
game_scores;" |
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
library(lubridate) | |
year("2012-12-12") | |
#[1] 2012 | |
day("2012-12-12") | |
#[1] 12 | |
ymd("2012-12-12") | |
#1 parsed with %Y-%m-%d | |
#[1] "2012-12-12 UTC" |
OlderNewer