in src/responsibleai/rai_analyse/_score_card/common_components.py [0:0]
def get_de_bar_plot(data):
y_data = [
y["label"] + "<br>" + str(int(y["population"] * 100)) + "% n"
for y in data["classes"]
]
x_data = [int(float(x["prediction_0_ratio"]) * 100) for x in data["classes"]]
x_data = [[x, 100 - x] for x in x_data]
legend = ['Predicted as "' + y["prediction_0_name"] + '"' for y in data["classes"]]
tickvals = [0, 25, 50, 75, 100]
ticktext = [str(x) + "%" for x in tickvals]
return get_bar_plot(
y_data,
x_data,
legend=legend,
tickvals=tickvals,
ticktext=ticktext,
tickappend="%",
)