Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
REPL <- function() { | |
while(T) { | |
print(eval(parse(text=readline("NG>>")))) | |
} | |
} | |
REPL() |
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
;; A first attempt at creating bayesian a spam filter from stratch | |
;; Trying to do this in lisp as a learning exercise | |
;; Definitely still a work in progress... | |
(defparameter *spam* '(this is a spam document that is fake news)) | |
(defparameter *ham* '(this is nikhils document)) | |
(defparameter *testdoc* '(this is a test document that is meant to be fake)) | |
(setq spam-table (make-hash-table)) | |
(setq ham-table (make-hash-table)) |
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(randomForest) | |
library(RJSONIO) | |
library(ROCR) | |
# Research Questions | |
# 1. What are the ranked importances of node encodings? | |
# 2. What are the ranked importances of edge encodings? | |
# 3. How important is network structure to noticeability? | |
# 3a. Where do participants tend to click? |
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(syuzhet) | |
library(igraph) | |
library(RCurl) | |
plotDashBoard <- function(ticker) { | |
twits <- getURL(paste("https://api.stocktwits.com/api/2/streams/symbol/",ticker,".json", sep="")) | |
twts.tab <- fromJSON(twits) | |
# Sentiment | |
twt.sent <- get_nrc_sentiment(twts.tab$messages$body) |
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(rjson) | |
apikey = 'REDACTED' # please get one from wines.com | |
url <- paste('http://services.wine.com/api/beta2/service.svc/json/catalog?filter=categories(614)&offset=0&size=100&apikey=',apikey,sep="") | |
document <- fromJSON(file=url, method='C') | |
# I am pulling down light and crispy white wine data above | |
ds <- matrix(0, 100, 3) | |
for (i in 1:length(document$Products$List)) { | |
ds[i,] <- c(as.numeric(document$Products$List[[i]]$PriceRetail), | |
as.numeric(document$Products$List[[i]]$Ratings$HighestScore), |
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
from flask import Flask, url_for, render_template, g, redirect | |
import random | |
import sqlite3 | |
DATABASE = 'quotes.db' | |
app = Flask(__name__) | |
def connect_db(): | |
return sqlite3.connect(DATABASE) |