Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if old_optimizer:
if control:
raise ValueError(
"Must specify EITHER control OR old_optimizer not both"
)
else:
control = "optimizer='bobyqa'"
if factors:
dat = self._make_factors(factors, ordered)
self.factors = factors
else:
dat = self.data
if rank:
if not rank_group:
raise ValueError("rank_group must be provided if rank is True")
dat = _to_ranks_by_group(
self.data, rank_group, self.formula, rank_exclude_cols
)
if factors and (set(factors.keys()) != set(rank_exclude_cols)):
w = "Factors and ranks requested, but factors are not excluded from rank conversion. Are you sure you wanted to do this?"
warnings.warn(w)
self.warnings.append(w)
if conf_int == "boot":
self.sig_type = "bootstrapped"
else:
if permute:
self.sig_type = "permutation" + " (" + str(permute) + ")"
else:
self.sig_type = "parametric"
if self.family == "gaussian":
_fam = "gaussian"
if verbose: