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

Method __init__

rl/approx_prediction.py:44–53  ·  view source on GitHub ↗
(self, grid)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

gather_samplesFunction · 0.70
fitMethod · 0.45

Tested by

no test coverage detected