Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _add_common_lin(self, alpha, nchoices, njobs):
if isinstance(alpha, int):
alpha = float(alpha)
assert isinstance(alpha, float)
_BasePolicy._add_choices(self, nchoices)
_check_constructor_input(_ZeroPredictor(), nchoices)
self.njobs = _check_njobs(njobs)
self.alpha = alpha
self.nchoices = nchoices
self._oracles = [_LinUCBnTSSingle(self.alpha, self._ts) for n in range(nchoices)]
if not self._ts:
self.v_sq = self.alpha
del self.alpha
self.is_fitted = False