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

Method __init__

rl/cartpole.py:45–54  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

43
44class Model:
45 def __init__(self, env):
46 # fit the featurizer to data
47 self.env = env
48 samples = gather_samples(env)
49 self.featurizer = RBFSampler()
50 self.featurizer.fit(samples)
51 dims = self.featurizer.n_components
52
53 # initialize linear model weights
54 self.w = np.zeros(dims)
55
56 def predict(self, s, a):
57 sa = np.concatenate((s, [a]))

Callers

nothing calls this directly

Calls 2

gather_samplesFunction · 0.70
fitMethod · 0.45

Tested by

no test coverage detected