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 csv, sqlite3, sys | |
file_to_read = sys.argv[1] | |
db_name = sys.argv[2] | |
table_name = sys.argv[3] | |
manifest = sys.argv[4] # lists header names and data types | |
con = sqlite3.connect("./"+db_name) | |
cur = con.cursor() | |
# Read Manifest | |
# Make create table query using manifest |
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
# The first step is to load the pre-trained vectors into python. The example below uses glove data. | |
import os | |
GLOVE_DIR = "/path/to/pretrained/embeddings/glove.6B/" | |
embeddings_index = {} | |
f = open(os.path.join(GLOVE_DIR, 'glove.6B.100d.txt'), "r") | |
for line in f: | |
values = line.split() | |
word = values[0] | |
coefs = np.asarray(values[1:], dtype='float32') | |
embeddings_index[word] = coefs |
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
# Toy Example of LSTM | |
## Relevant Links | |
* https://www.kaggle.com/amirrezaeian/time-series-data-analysis-using-lstm-tutorial | |
* https://stackoverflow.com/questions/13703720/converting-between-datetime-timestamp-and-datetime64 | |
* https://visualstudiomagazine.com/articles/2014/01/01/how-to-standardize-data-for-neural-networks.aspx | |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Sep 23 23:16:44 2017 | |
@author: Marios Michailidis | |
This is an example that performs stacking to improve mean squared error | |
This examples uses 2 bases learners (a linear regression and a random forest) | |
and linear regression (again) as a meta learner to achieve the best score. | |
The initial train data are split in 2 halves to commence the stacking. |
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
{ | |
"created_at": "Mon Jul 17 21:05:24 +0000 2017", | |
"id": 887055659015032837, | |
"id_str": "887055659015032837", | |
"text": "RT @TEN000HOURS: The MIGOS of AAU Basketball... https:\/\/t.co\/h5lGeWHqpu", | |
"source": "\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e", | |
"truncated": false, | |
"in_reply_to_status_id": null, | |
"in_reply_to_status_id_str": null, | |
"in_reply_to_user_id": null, |
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
#### | |
# Eigens | |
##### | |
# How to calculate covariance matrix | |
# Great video: https://www.youtube.com/watch?v=9B5vEVjH2Pk | |
dat <- as.matrix( | |
cbind(c(90, 90, 60, 30, 30), | |
c(80, 60, 50, 40, 20), | |
c(40, 80, 70, 70, 70)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder