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
notebook: | |
image: my-data-science-docker:0.1 | |
ports: | |
- "80:8888" | |
environment: | |
- WISEDS_CODE_DIR=${PWD} | |
- WISEDS_DATA_DIR=${PWD}/data | |
# - IPYTHON_PASSWORD=WhoMe321 | |
- PASSWORD=WhoMe321 | |
- KERAS_BACKEND=theano |
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 ubuntu:16.04 | |
#FROM ubuntu:14.04 | |
# Extended and moved to python 3 based on image: | |
#MAINTAINER Wise.io, Inc. <help@wise.io> | |
ENV DEBIAN_FRONTEND noninteractive | |
ENV PATH /anaconda/bin:$PATH | |
# For image inheritance. | |
ONBUILD ENV PATH /anaconda/bin:$PATH |
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(deSolve) | |
handyMod <- function(Time, State, Pars) { | |
with(as.list(c(State, Pars)), { | |
# First calculate threshold below which famine begins | |
# rho = minimum required consumption | |
wThresh = rho * popC + rho * kappa * popE | |
# Check to avoid dividing by zero then estimate consumption of | |
# commons = cC and elites = cE | |
if(wThresh > 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
# BayesProbability.R | |
#set.seed(49) | |
# Build a dummy dictionary | |
a <- letters | |
b <- letters | |
tokens <- apply(expand.grid(a, b), 1, function(x) paste(x, collapse="")) | |
# Number of tokens to use 1-676 | |
tl <- 100 |
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
# Try setting up a smaller test set | |
# Variables to set how large a square of data to test | |
npatients <- 4 | |
nreadings <- 8 | |
# We are still not converging in 500 trials. Perhaps we have too many unknowns. | |
#nleads <- 10 | |
nleads <- 12 | |
load("cardiacSetup.rda") |
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
# Cost and gradient functions for optim(). These are a port of Coursera | |
# Machine Learning course topic Collaborative Filtering from MATLAB | |
# to R. | |
# Cost Function | |
coFilterCost <- function (params, npatients, nleads, nreadings,Y, R, lambda) | |
{ | |
# params: X and Theta flattened to vector | |
# npatients, nleads, nreadings: number of patients, leads, and numeric | |
# fields in data |
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
cardiac <- read.csv("arrhythmia.data", header=F, na.strings="?") | |
colnames(cardiac)[1:280] <- c("Age","Gender_Nom","Height","Weight","QRS_Dur", | |
"P-R_Int","Q-T_Int","T_Int","P_Int","QRS","T","P","QRST","J","Heart_Rate", | |
"Q_Wave","R_Wave","S_Wave","R_Prime","S_Prime","Int_Def","Rag_R_Nom", | |
"Diph_R_Nom","Rag_P_Nom","Diph_P_Nom","Rag_T_Nom","Diph_T_Nom", | |
"DII00", "DII01","DII02", "DII03", "DII04","DII05","DII06","DII07","DII08","DII09","DII10","DII11", | |
"DIII00","DIII01","DIII02", "DIII03", "DIII04","DIII05","DIII06","DIII07","DIII08","DIII09","DIII10","DIII11", | |
"AVR00","AVR01","AVR02","AVR03","AVR04","AVR05","AVR06","AVR07","AVR08","AVR09","AVR10","AVR11", | |
"AVL00","AVRL1","AVL02","AVL03","AVL04","AVL05","AVL06","AVL07","AVL08","AVL09","AVL10","AVL11", | |
"AVF00","AVF01","AVF02","AVF03","AVF04","AVF05","AVF06","AVF07","AVF08","AVF09","AVF10","AVF11", |