import streamlit as st
import streamlit.components.v1 as components
import os
ROOT_FIG_DIR = f'{os.getcwd()}/figures/'
def get_product_dev_page_layout():
# row6_1, row6_2, = st.columns((1,1))
row6_1, row6_2,row6_3 = st.tabs(["Evaluation Metrics", "Performance Evaluation", "Issues and Limitations"])
with row6_1:
# st.write("**Performance Metrics**")
st.subheader('Performance Metrics')
st.write('Following metrics are used for evaluation:')
st.image(f'{ROOT_FIG_DIR}/eval_metrics.png')
list_test = """
- Accuracy: is the ratio of correctly predicted observation to the total observations..
"""
st.markdown(list_test, unsafe_allow_html=True)
# st.latex(r''' Accuracy=\frac{TP + TN}{TP+TN+FP+FN}''')
list_test = """
- Precision: is the ratio of correctly predicted positive observations to the total predicted positive observations
"""
st.markdown(list_test, unsafe_allow_html=True)
# st.latex(r''' Precision=\frac{TP}{TP+FP}''')
list_test = """
- Recall: is the ratio of correctly predicted positive observations to all observations in the actual class.
"""
st.markdown(list_test, unsafe_allow_html=True)
# st.latex(r''' Recall=\frac{TP}{TP+FN}''')
# with st.expander('Test Set Confusion Matrix'):
# # st.caption('Test Set Results:')
# st.image('./figures/test_confmat_20210404.png')
with row6_2:
st.subheader('Test Set Confusion Matrix')
st.image(f'{ROOT_FIG_DIR}/test_confmat_20210404.png')
with st.expander('Click to Explore Test Data Details'):
HtmlFile = open(f'{ROOT_FIG_DIR}/test_set_report.html', 'r', encoding='utf-8')
source_code = HtmlFile.read()
components.html(source_code,scrolling=True, height=500)
with row6_3:
st.write("After examining the performance of the AI model, it was found that the main misclassifications occur in the CNV and NORMAL classes. One can also see this in the given confusion matrix under the Performance Evaluation tab. In particular, CNV cases are often confused with DME and DRUSEN. This can be attributed to the specific characteristics of CNV images present within the dataset. Therefore, it is recommend to thoroughly review the decisions made for CNV cases.")
st.warning('Mis classified CNV Samples')
st.image(f'{ROOT_FIG_DIR}/cnv_missclass.png')
st.warning('Mis classified NORMAL Samples')
st.image(f'{ROOT_FIG_DIR}/normal_missclass.png')