Conditions | 2 |
Total Lines | 19 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """Base class for experiment.""" |
||
41 | def score(self, params): |
||
42 | """Score the parameters. |
||
43 | |||
44 | Parameters |
||
45 | ---------- |
||
46 | params : dict with string keys |
||
47 | Parameters to score. |
||
48 | |||
49 | Returns |
||
50 | ------- |
||
51 | float |
||
52 | The score of the parameters. |
||
53 | dict |
||
54 | Additional metadata about the search. |
||
55 | """ |
||
56 | paramnames = self.paramnames() |
||
57 | if not set(params.keys()) <= set(paramnames): |
||
58 | raise ValueError("Parameters do not match.") |
||
59 | return self._score(params) |
||
60 | |||
77 |