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) | |
library(sqldf) | |
library(KernSmooth) | |
# Connect to the database | |
drv <- dbDriver("PostgreSQL") | |
con <- dbConnect(drv, dbname='odw', host='localhost', user='panos', password='password', port='12345') | |
# Retrieve the data from the database. | |
# Query columns: active_contractors, total_contractors, percent_activity, local_dayoftheweek, local_hour, country |
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
Data points: 500 | |
Workers: 5 | |
Low rho: 0.1 | |
High rho: 0.9 | |
---- | |
Round: 1... 2... 3... 4... 5... 6... 7... 8... 9... 10... 11... 12... 13... 14... 15... 16... Done! | |
---- | |
True mu = 0.0 | |
Estimated mu = -2.4669698323703853 | |
True sigma = 1.0 |
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
Data points: 1000 | |
Workers: 50 | |
Low rho: 0.0 | |
High rho: 0.5 | |
---- | |
Round: 1... | |
Average absolute estimation error for z-values: 0.7216256823227171 | |
Average relative estimation error for z-values: 1.202467298579486 | |
Average absolute estimation error for correlation values: 0.003948409074838416 | |
Average relative estimation error for correlation values: 0.035579687445173605 |
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
{ | |
"http": 200, | |
"message": "success", | |
"terms": [ | |
{ | |
"term": "Barack Obama", | |
"canonical": 1, | |
"oskill": 0 | |
}, | |
{ |
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
{ | |
"http": 200, | |
"message": "success", | |
"terms": [ | |
{ | |
"term": "Hillary Rodham Clinton", | |
"canonical": 1, | |
"oskill": 0 | |
}, | |
{ |
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
{ | |
"http": 200, | |
"message": "success", | |
"terms": [ | |
{ | |
"term": "C++", | |
"canonical": 1, | |
"oskill": 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
{ | |
"http": 300, | |
"message": "The entry is a disambiguation page in Wikipedia. Please query again with one of the returned terms", | |
"terms": [ | |
"Armstrong Siddeley Python", | |
"CMU Common Lisp", | |
"CPython", | |
"Colt Python", | |
"Computer", | |
"Monty Python", |
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
{ | |
"http": 200, | |
"message": "success", | |
"terms": [ | |
{ | |
"term": "Python (programming language)", | |
"canonical": 1, | |
"oskill": 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
### Cohort Analysis | |
import matplotlib.pyplot as plt | |
# Connect to the BigQuery API | |
from googleapiclient.discovery import build | |
from oauth2client import client | |
credentials = client._get_application_default_credential_from_file('client_secrets.json') | |
credentials = credentials.create_scoped('https://www.googleapis.com/auth/bigquery') |
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
firstSeen | lastSeen | cnt | |
---|---|---|---|
2014-05 | 2014-05 | 882 | |
2014-05 | 2014-06 | 255 | |
2014-05 | 2014-07 | 108 | |
2014-05 | 2014-08 | 93 | |
2014-05 | 2014-09 | 68 | |
2014-05 | 2014-10 | 44 | |
2014-05 | 2014-11 | 59 | |
2014-05 | 2014-12 | 35 | |
2014-05 | 2015-01 | 33 |
OlderNewer