Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
victorkristof committed Aug 12, 2020
1 parent e8af8f6 commit d2e0dd9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ pred = model.fit_predict(y)
# All unobserved entries in `y` are now filled in.
```

You can then obtain a prediction for the aggregate outcome as (assuming the weights are the number of valid votes):
You can then obtain a prediction for the aggregate outcome (assuming the weights are the number of valid votes in this example) as:

```python
N = w.sum() # Total number of votes.
yaggr = y.dot(w) / N
ypred = pred.dot(w) / N
ytrue = y.dot(w) / N
print(abs(ypred - ytrue))
```

Have a look at the [example notebook](notebooks/example.ipynb) for a complete example of how to use the `predikon` library (with Swiss referenda).
Expand Down

0 comments on commit d2e0dd9

Please sign in to comment.