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
my_dict = dict({ | |
1 : "", | |
2 : "", | |
3 : "oyy", | |
"oyy" : "", | |
1990 : 's kid', | |
2000 : "a", | |
2014 : "b", | |
2015 : "c", | |
"foo" : "bar", |
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 math | |
import random | |
def categorical_draw(probs): | |
''' | |
if | |
P(A) = .5 | |
P(B) = .2 | |
P(C) = .3 |
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 math | |
import random | |
def categorical_draw(probs): | |
''' | |
if | |
P(A) = .5 | |
P(B) = .2 | |
P(C) = .3 |
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 | |
class EpsGreedy() | |
def __init__(self, number_of_bandits, epsilon, start_greedy= True): | |
self.count = np.zeros(number_of_bandits) | |
self.scores = np.array([int(!start_greedy)] * number of bandits) | |
self.epsilon = epsilon | |
self.bandit_count = number_of_bandits | |
def select_arm(): | |
choice = np.random.binomial(1,self.epsilon): | |
if choice = 1: #EXPLORE |
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
class B: | |
def __init__(self): | |
self.data = [] | |
def update(self, row): | |
for r in row: | |
self.data.append(r) | |
def finalize(self): | |
return np.reshape(self.data, newshape=(len(self.data)/5, 5)) | |
ax = B() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder