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 python3 | |
#-*- coding:utf-8 -*- | |
import os | |
import numpy as np | |
MDE = .01 | |
POWER = .8 | |
BOOT_SIZE = 1000 | |
BOOT_RUNS = 256 |
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 python3 | |
#-*- coding:utf-8 -*- | |
import random | |
import os | |
import binascii |
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
{ | |
"accountId": "12345", | |
"projectId": "23456", | |
"revision": "6", | |
"version": "2", | |
"experiments": [ | |
{ | |
"key": "my_experiment", | |
"id": "45678", | |
"layerId": "34567", |
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
# list all containers | |
docker ps -aq | |
# stop running containers | |
docker stop $(docker ps -aq) | |
# remove all containers | |
docker rm $(docker ps -aq) | |
# remove all images |
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 boto3 | |
S3 = boto3.resource('s3', region_name='us-west-2') | |
fpath = '/path/to/local/file/to/upload.txt' | |
s3_path = '/path/to/file/in/s3.txt' |
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
belief = Beta(2,2) # belief is instance of Beta | |
data = None | |
while True: | |
data = get_new_data() | |
belief = belief * likelihood(data) | |
assert IsInstance(belief, Beta) == True # belief remains an instance of Beta |
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
%matplotlib inline | |
import numpy as np | |
import scipy.stats as stats | |
from IPython.core.pylabtools import figsize | |
import matplotlib.pyplot as plt | |
figsize(12.5, 5) | |
params = [(2, 5), (1, 1), (0.5, 0.5), (5, 5), (20, 4), (5, 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
def prob_b_winning(a_success, a_fail, b_success, b_fail): | |
predict = 0 | |
for i in range(b_success): | |
predict += math.exp(beta_l(a_success + i, b_fail + a_fail) | |
- math.log(b_fail + i) | |
- beta_l(1 + i, b_fail) | |
- beta_l(a_success, a_fail)) | |
return predict |
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 scipy.stats import beta | |
import matplotlib.pyplot as plt | |
import numpy as np | |
a = 2 | |
b = 12 | |
x = np.arange(0.001, 1, 0.01) | |
y = beta.pdf(x, a, b) |
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 beta_1(a, b): | |
return math.gamma(a) * math.gamma(b) / math.gamma(a + b) | |
NewerOlder