src/beanmachine/tutorials/utils/baseball.py [450:517]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        x_axis_label="Observed hits / at-bats",
        y_axis_label="Predicted chance of a hit",
        x_range=[0.14, 0.41],
        y_range=[0.05, 0.55],
    )

    # Add the mean at-bat hit chance to the figure.
    plot.line(
        x=[0, 1],
        y=[population_mean, population_mean],
        line_color="orange",
        line_width=3,
        level="underlay",
        legend_label="Population mean",
    )

    # Add the standard deviation of the current mean at-bat hit chance to the
    # figure.
    std_band = Band(
        base="x",
        lower="lower_std",
        upper="upper_std",
        source=source,
        level="underlay",
        fill_alpha=0.2,
        fill_color="orange",
        line_width=0.2,
        line_color="orange",
    )
    plot.add_layout(std_band)

    # Add the empirical current at-bat hits to the figure.
    plot.line(
        x=x,
        y=(df["Current hits"] / df["Current at-bats"]).values,
        line_color="grey",
        line_alpha=0.7,
        line_width=2.0,
        legend_label="Current hits / Current at-bats",
    )

    # Add HDI whiskers to each player in the figure.
    whiskers = Whisker(
        base="x",
        upper="upper_hdi",
        lower="lower_hdi",
        source=source,
        line_color="steelblue",
    )
    whiskers.upper_head.line_color = "steelblue"
    whiskers.lower_head.line_color = "steelblue"
    plot.add_layout(whiskers)

    # Add the modeled player at-bat hit chance to the figure.
    glyph = plot.circle(
        x="x",
        y="y",
        source=source,
        size=10,
        line_color="white",
        fill_color="steelblue",
        legend_label="Players",
    )
    tooltips = HoverTool(
        renderers=[glyph],
        tooltips=[
            ("Name", "@name"),
            ("Posterior Upper HDI", "@upper_hdi{0.000}"),
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/beanmachine/tutorials/utils/baseball.py [671:737]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        x_axis_label="Observed hits / at-bats",
        y_axis_label="Predicted chance of a hit",
        x_range=[0.14, 0.41],
        y_range=[0.05, 0.55],
    )

    # Add the empirical mean at-bat hit chance to the figure.
    plot.line(
        x=[0, 1],
        y=[population_mean, population_mean],
        line_color="orange",
        line_width=3,
        level="underlay",
        legend_label="Population mean",
    )

    # Add the standard deviation of the mean at-bat hit chance to the figure.
    std_band = Band(
        base="x",
        lower="lower_std",
        upper="upper_std",
        source=source,
        level="underlay",
        fill_alpha=0.2,
        fill_color="orange",
        line_width=0.2,
        line_color="orange",
    )
    plot.add_layout(std_band)

    # Add the empirical at-bat hit chance to the figure.
    plot.line(
        x=x,
        y=(df["Current hits"] / df["Current at-bats"]).values,
        line_color="grey",
        line_alpha=0.7,
        line_width=2.0,
        legend_label="Current hits / Current at-bats",
    )

    # Add the HDI whiskers to the figure.
    whiskers = Whisker(
        base="x",
        upper="upper_hdi",
        lower="lower_hdi",
        source=source,
        line_color="steelblue",
    )
    whiskers.upper_head.line_color = "steelblue"
    whiskers.lower_head.line_color = "steelblue"
    plot.add_layout(whiskers)

    # Add the partial-pooling model data to the figure.
    glyph = plot.circle(
        x="x",
        y="y",
        source=source,
        size=10,
        line_color="white",
        fill_color="steelblue",
        legend_label="Players",
    )
    tooltips = HoverTool(
        renderers=[glyph],
        tooltips=[
            ("Name", "@name"),
            ("Posterior Upper HDI", "@upper_hdi{0.000}"),
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



