Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from utils import AgeAnalysis | |
| age_analytics = AgeAnalysis() | |
| st.markdown("##### Identity theft") | |
| st.caption("Identity theft occurs when someone uses another person's personal identifying information, like their name, identifying number, or credit card number, without their permission, to commit fraud or other crimes.") | |
| st.markdown(""" | |
| * :violet[Minimum age in the dataset is **19**] | |
| * :violet[Maximum age in the dataset is **99**] | |
| * Fraudulent Transactions made by :orange[age group 80+] could be considered **identity theft** | |
| """) | |
| age_category, query_result = st.columns([0.3,0.7]) | |
| with age_category: | |
| query = st.radio( | |
| label="Choose the age block", | |
| options=['Less than 25', 'Between 25 and 50', 'Below 50', | |
| 'Above 50', 'Between 50 and 60', 'Above 60', 'Above 80'] | |
| ) | |
| with query_result: | |
| with st.spinner("⏳Querying..."): | |
| response_data, fig = age_analytics.age_realted_query(query) | |
| st.pyplot(fig=fig, use_container_width=True) | |
| st.markdown( | |
| f""" | |
| * Number of Transactions made by age block:`{query}` is :blue[{response_data.shape[0]}] | |
| * Number of Fraudulent Transaction made by age block:`{query}` is | |
| :red[{response_data.query("Fraud=='Yes'").shape[0]}] | |
| """) | |