leaderbot.models.Davidson.predict#
- Davidson.predict(x=None)#
Predict outcome between competitors.
- Parameters:
- xnp.ndarray, list, zip, or leaderbot.data.DataType
A 2D array (or equivalent list or zip) of integers with the shape
(n_pairs, 2)where each row consists of indices[i, j]representing a match between a pair of agents with the indicesiandj. Alternatively, a dictionary of the typeleaderbot.data.DataTypecan be provided. If None, theXvariable from the input data is used.
- Returns:
- probnp.array
An array of the shape
(n_agents, )where each entry represents the following codes:+1: agentiwinsj.0: agentitiesj.-1: agentilosses toj.
- Raises:
- RuntimeError
If the model is not trained before calling this method.
See also
Examples
>>> from leaderbot.data import load >>> from leaderbot.models import Davidson >>> # Create a model >>> data = load() >>> model = Davidson(data) >>> # Train the model >>> model.train() >>> # Make prediction >>> x = list(zip((0, 1, 2), (1, 2, 0))) >>> pred = model.predict(x)