INNER CODE UNIT · Python
plot_pie
featurestoreorg/serverless-ml-course · src/04-module/cc-fraud-streamlit-ui.py:63
def plot_pie(values, labels):
fig = px.pie(values=values, names=labels, title='Distribution of predicted fraud transactions')
return fig
fig1 = plot_pie(values, labels)
st.plotly_chart(fig1)
def print_fancy_header(text, font_size=24):
res = f'<span style="color:#ff5f27; font-size: {font_size}px;">{text}</span>'
st.markdown(res, unsafe_allow_html=True)
def transform_preds(predictions):
return ['Fraud' if pred == 1 else 'Not Fraud' for pred in predictions]
progress_bar = st.sidebar.header('⚙️ Working Progress')
progress_bar = st.sidebar.progress(0)
st.title('🆘 Fraud transactions detection 🆘')