My second app (Learning analytics web for school teachers)

Hello all,
I have deployed the learning data analysis web app at the following URL.

https://share.streamlit.io/59er/eng_learning_analytics_web/eng_edu_login_app.py

User ID: demo01
Password: demo01

Or you can make your account by selecting user registration from Menu.

This web app is created for school teachers to analyze student performance
to improve their educational guidance, learning support and teaching materials and so on.

There are 12 menus for learning data analysis as follows:

  • Overview of learning situation:
  • Detailed analysis:
  • Correlation analysis:
  • Score prediction:
  • Pass/Fail Prediction:
  • Questionnaire text mining
  • Exam questions/questionnaire reliability measurement:
  • Difficulty and discrimination analysis for Exam Questions:
  • Cluster analysis:
  • t-test:
  • Factor analysis:
  • Time series analysis:

You can see sample csv file format to click “Download the sample csv file” link.
You can try each analytic function by uploading some learning data file using ‘Browse files’ button.

I am afraid that I do not know how to make download link to download sample csv file from streamlit share site.
Also, the dtreeviz and SHAP libraries are not working on the Streamlit site, so I am currently investigating.

Your comments on this app are really welcomed.

Thank you.

2 Likes

Please try using the following, it provides a downloadable link for dataFrames. You can read a CSV file as a dataFrame using a library like Pandas and input it to this function.

def download_link(object_to_download, download_filename, download_link_text):
    
    if isinstance(object_to_download,pd.DataFrame):
        object_to_download = object_to_download.to_csv(index=False)

    
    b64 = base64.b64encode(object_to_download.encode()).decode()

    return f'<a href="data:file/txt;base64,{b64}" download="{download_filename}">{download_link_text}</a>'

Usage:

tmp_download_link = download_link(download_df, 'similar.csv', 'Click here to download your data!')
st.markdown(tmp_download_link, unsafe_allow_html=True)

Thanks to your advice, I was able to add a download link for the sample data. Also, the version up of numpy allows SHAP to work.

In my case, the Japanese part of the download file was garbled, so I solved the garbling by adding ‘utf-8-sig’ as shown below.

def download_link(object_to_download, download_filename, download_link_text):
if isinstance(object_to_download,pd.DataFrame):
object_to_download = object_to_download.to_csv(index=False)
b64 = base64.b64encode(object_to_download.encode(‘utf-8-sig’)).decode()
return f’{download_link_text}

I have deployed a demo version without login accounts as follows:

https://share.streamlit.io/59er/eng_la_web_demo/eng_main_la_demo_app.py

Now I’ll investigate to solve the dtreeviz problem.
Considering the error log below, it may be due to pandas version inconsistency.
But the dtreeviz works on the Ubuntu based Linux server in my home with pandas 1.1.5.

   Successfully built ptitprince japanize-matplotlib shap dtreeviz sklearn factor-analyzer retrying blinker pyLDAvis future pyrsistent pandocfilters
   ERROR: pyldavis 3.3.1 has requirement numpy>=1.20.0, but you'll have numpy 1.19.5 which is incompatible.
   ERROR: pyldavis 3.3.1 has requirement pandas>=1.2.0, but you'll have pandas 1.1.5 which is incompatible.

Thank you.

I added Kaiser-Meyer-Olkin (KMO) Test function as the menu title “Sampling Adequacy”.
KMO test is a measure of how suited the data is for Factor Analysis.
The test measures sampling adequacy for each variable in the model.
KMO values between 0.8 and 1 indicate the sampling is adequate.
KMO values less than 0.6 indicate the sampling is not adequate and that remedial action should be taken.
WEB app URL is as follows:
https://share.streamlit.io/59er/eng_la_web_demo/eng_main_la_demo_app.py

I solved the problem of dtreeviz not working in Streamlit (decision tree not showing up).
Simply, I wrote “graphviz” in packages.txt and added it to the Github source.

Thank you.