Created
May 25, 2020 16:59
-
-
Save chilang/beab86d32593478ad1f833532f7ede88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _collect_models(self, runners, N): | |
r_intercepts, r_coefs, r_weights = [], [], [] | |
self.models = [] | |
for runner in random.sample(runners, k=self.sample_size): | |
r_model = runner.optimise(self.intercept_, self.coef_, self.runner_hyperparams) | |
self.models.append(r_model) | |
r_intercepts.append(r_model.intercept_) | |
r_coefs.append(r_model.coef_) | |
r_weights.append(runner.dataset_size()/N if self.combine == 'weighted' else 1/self.sample_size) | |
return r_intercepts, r_coefs, r_weights |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment