MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / predict

Method predict

rl/approx_control.py:69–72  ·  view source on GitHub ↗
(self, s, a)

Source from the content-addressed store, hash-verified

67 self.w = np.zeros(dims)
68
69 def predict(self, s, a):
70 sa = merge_state_action(s, a)
71 x = self.featurizer.transform([sa])[0]
72 return x @ self.w
73
74 def predict_all_actions(self, s):
75 return [self.predict(s, a) for a in ALL_POSSIBLE_ACTIONS]

Callers 2

predict_all_actionsMethod · 0.95
approx_control.pyFile · 0.45

Calls 2

merge_state_actionFunction · 0.85
transformMethod · 0.45

Tested by

no test coverage detected