Skip to content

Commit

Permalink
Merge pull request #422 from oughtinc/sort-components-before-metaculu…
Browse files Browse the repository at this point in the history
…s-submission

Sort components by descending weight before Metaculus submission
  • Loading branch information
uvafan committed Oct 6, 2020
2 parents cdcb388 + 62d14dc commit f3d28f9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ergo/platforms/metaculus/question/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,16 @@ def format_logistic_for_api(submission: dist.Logistic, weight: float) -> dict:
}

def submit(self, submission: dist.LogisticMixture) -> requests.Response:

prediction_data = {
"prediction": {
"kind": "multi",
"d": [
self.format_logistic_for_api(c, submission.probs[i])
for i, c in enumerate(submission.components)
],
"d": sorted(
[
self.format_logistic_for_api(c, submission.probs[i])
for i, c in enumerate(submission.components)
],
key=lambda l: -l["w"],
),
},
"void": False,
}
Expand Down

0 comments on commit f3d28f9

Please sign in to comment.