INNER CODE UNIT · Python
plot_noshow_by_age
alteryx/open_source_demos · predict-appointment-noshow/utils.py:160
def plot_noshow_by_age(X):
source = ColumnDataSource(X.tail(5000).groupby('age').apply(lambda x: x.tail(1)))
hover = HoverTool(tooltips=[
("Prob", "@{ages.PERCENT_TRUE(appointments.no_show)}"),
("Age", "@age"),
])
p7 = figure(title="Probability no-show by Age",
x_axis_label='Age',
y_axis_label='Probability of no-show',
width=400,
height=400,
tools=[hover, 'box_zoom', 'reset', 'save']
)
p7.scatter('age', 'ages.PERCENT_TRUE(appointments.no_show)',
alpha=.7,