leaderbot.models.Davidson.plot_scores#
- Davidson.plot_scores(max_rank=None, horizontal=False, plot_range=None, bg_color='none', fg_color='black', save=False, latex=False)#
Plots competitors’ scores by rank.
- Parameters:
- max_rankint, default=None
The maximum number of agents to be displayed. If None, all agents in the input dataset will be ranked and shown.
- horizontalbool, default=False
If True, horizontal bars will be plotted, otherwise, vertical bars will be plotted.
- plot_rangetuple or list, default=None
A tuple or list of minimum and maximum range of the plot limits.
- bg_colorstr or tuple, default=’none’
Color of the background canvas. The default value of
'none'
means transparent.- fg_colorstr or tuple, default=’black’
Color of the axes and text.
- savebool, default=False
If True, the plot will be saved. This argument is effective only if
plot
is True.- latexbool, default=False
If True, the plot is rendered with LaTeX engine, assuming the
latex
executable is available on thePATH
. Enabling this option will slow the plot generation.
- 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() >>> # Plot scores by rank >>> model.plot_scores(max_rank=50)