Skip to content

Commit

Permalink
add slateNegativeSampleWeight to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
Oege Dijk committed Dec 9, 2023
1 parent 5d0a010 commit fed1695
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 @@ -126,6 +126,8 @@ You can pass slateSize as a parameter to the bandit, or to the slate method itse
slate = bandit.slate({ rain: 1 }, { slateSize: 3 });
```

When you call `bandit.choose(...)` you generate both an accept training data point for the chosen `actionId`, and rejection training data points for the not-chosen `slateItems`. You can set a lower sample weight on the rejected options with e.g. `slateNegativeSampleWeight=0.5`.`

### Serializing and storing bandits

You can easily serialize/deserialize bandits to/from JSON. So you can store e.g. a personalized bandit for each user and load them on demand.
Expand All @@ -147,7 +149,7 @@ bandit2.train(trainingData);

## Defining custom oracle

For more control over the behaviour of your bandit, you customize the oracle:
For more control over the behaviour of your bandit, you can customize the oracle:

```typescript
oracle = new SimpleOracle({
Expand Down Expand Up @@ -233,7 +235,7 @@ slate = bandit.slate(context, { include: ["banana", "pear"] });
## Examples

There are several usage examples provided in the `examples/` folder (built with react).
You can run the examples with e.g. `parcel examples/index.html` or `make example` and then view them on e.g. `http://localhost:1234`.
You can run the examples with `parcel examples/index.html` or `make example` and then view them on e.g. `http://localhost:1234`.

Or simply visit [https://thoughtworks.github.io/simplebandit/](https://thoughtworks.github.io/simplebandit/).

Expand Down

0 comments on commit fed1695

Please sign in to comment.