Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
"Ecrin" | |
"Eymen" | |
"Ceylin" | |
"Ebrar" | |
"Tuana" | |
"Esila" | |
"Esra" | |
"Enes" | |
"Talha" | |
"Ömer" |
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
"""Information Retrieval metrics | |
Useful Resources: | |
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt | |
http://www.nii.ac.jp/TechReports/05-014E.pdf | |
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf | |
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf | |
Learning to Rank for Information Retrieval (Tie-Yan Liu) | |
""" | |
import numpy as np |
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
# Docs: http://open-platform.theguardian.com/documentation/ | |
import requests as r | |
import json | |
g_api_key = "Your API key" # limit is 12 calls per second. | |
keyterm = "Your Keyterm" | |
#from-date=1920- | |
g_articles_strt = r.get("http://content.guardianapis.com/search?q="+keyterm+"/politics&show-blocks=all&from-date=2015-01-01&api-key="+g_api_key) |
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 requests as r | |
import json | |
import datetime | |
# Docs: http://developer.nytimes.com/docs | |
# Try at: http://developer.nytimes.com/io-docs | |
srch_api_key = "Your key <check docs>" | |
keyphrase = 'anything_you_want' | |
srch_api_result = r.get("http://api.nytimes.com/svc/search/v2/articlesearch.json?q="+keyphrase+"&api-key="+srch_api_key) |
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
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask.ext.httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): | |
if username == 'miguel': |
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
def plot_correlogram(df,figsize=(20,20)): | |
''' Creat an n x n matrix of scatter plots for every | |
combination of numeric columns in a dataframe''' | |
cols = list(df.columns[df.dtypes=='float64']) | |
n = len(cols) | |
fig, ax = plt.subplots(n,n,figsize=figsize) | |
for i,y in enumerate(cols): | |
for j,x in enumerate(cols): | |
if i != n-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
import numpy as np | |
from math import pi, log | |
import pylab | |
from scipy import fft, ifft | |
from scipy.optimize import curve_fit | |
i = 10000 | |
x = np.linspace(0, 3.5 * pi, i) | |
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 * | |
np.random.randn(i)) |
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
# code to connect to twiqs.nl API | |
# Current IP address of twiqs.nl is: http://145.100.57.182 | |
import requests | |
urlto_twiqsNL = "http://145.100.57.222/cgi-bin/twitter" | |
s = requests.Session() | |
r = s.post(urlto_twiqsNL, data={"NAME":user_name, "PASSWD":passwd}) | |
print('Cookie Created') |
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
#!/usr/bin/env python | |
import numpy as np | |
def medfilt (x, k): | |
"""Apply a length-k median filter to a 1D array x. | |
Boundaries are extended by repeating endpoints. | |
""" | |
assert k % 2 == 1, "Median filter length must be odd." |
NewerOlder