(self, grid)
| 42 | |
| 43 | class 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] |
nothing calls this directly
no test coverage detected