MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / predict

Method predict

rl2/cartpole/q_learning_bins.py:64–66  ·  view source on GitHub ↗
(self, s)

Source from the content-addressed store, hash-verified

62 self.Q = np.random.uniform(low=-1, high=1, size=(num_states, num_actions))
63
64 def predict(self, s):
65 x = self.feature_transformer.transform(s)
66 return self.Q[x]
67
68 def update(self, s, a, G):
69 x = self.feature_transformer.transform(s)

Callers 2

sample_actionMethod · 0.95
play_oneFunction · 0.45

Calls 1

transformMethod · 0.45

Tested by

no test coverage detected