in isoexp/linear/linearmab_models.py [0:0]
def __init__(self, random_state=0, noise=0., n_actions=4, n_features=4, reward_lim=(-np.inf, np.inf)):
features = np.random.randn(n_actions, n_features)
real_theta = np.random.randn(n_features) * 0.5
means = np.dot(features, real_theta)
idxs = (means < reward_lim[0]) | (means > reward_lim[1])
idxs = np.arange(n_actions)[idxs]
for i in idxs:
mean = -np.inf
feat = None
while mean > reward_lim[1] or mean < reward_lim[0]:
feat = np.random.randn(1, n_features)
mean = np.dot(feat, real_theta)
features[i, :] = feat
super(RandomNormalLinearArms, self).__init__(random_state=random_state, noise=noise,
features=features, theta=real_theta)