Skip to content
Snippets Groups Projects
Commit bd5af797 authored by terpst35's avatar terpst35
Browse files

Merge branch 'issue_100' into 'main'

Correction of Issue 102, I added instructions for installing on shared computer cluster.

See merge request CMSE/datatools_tutorial_demo!147
parents b577de11 3b753ae0
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# Streamlit Tutorial
%% Cell type:markdown id: tags:
![streamlit-2.png](https://cdn.analyticsvidhya.com/wp-content/uploads/2021/06/39595st.jpeg)
%% Cell type:markdown id: tags:
#### What is Streamlit?
Streamlit is an open-source Python library that can create web applications for data science concepts including machine learning.
%% Cell type:markdown id: tags:
### When running streamlit there are two possible installation methods
1. Installation on your own Computer
2. Installation on Shared Computer Cluster
%% Cell type:markdown id: tags:
#### How to install Streamlit on your computer:
In your terminal, type and enter:
_pip install streamlit_
To check if this worked properly, run:
_streamlit hello_
This command should open the Streamlit Hello application in your browser.
%% Cell type:markdown id: tags:
```bash
streamlit run streamlit_tutorial.py
```
%% Cell type:markdown id: tags:
Or run the cell below
%% Cell type:code id: tags:
``` python
! streamlit run streamlit_tutorial.py
```
%% Output
^C
%% Cell type:markdown id: tags:
## Installation on Shared Computer Cluster
In your terminal type and run each of these commands
```bash
module load Anaconda/3
conda activate base
pip install streamlit
```
To check if this worked properly, run:
```bash
streamlit hello
```
This command should open the Streamlit Hello application in your browser.
%% Cell type:markdown id: tags:
#### About the code
%% Cell type:markdown id: tags:
- Streamlit web app that uses a random forest to predict the class of an iris flower based on its sepal and petal lengths.
- Loads the data from scikit, then trains a random forest model, and defines widgets for the user to change values for sepal length, sepal width, petal length, and petal width.
- Defines a function to make predictions based on the user's inputs.
- When "Get Prediction" button is clicked, the app uses the prediction function and displays the predicted class of the iris flower as well as the estimates for each class.
%% Cell type:markdown id: tags:
### References
%% Cell type:markdown id: tags:
https://docs.streamlit.io/
https://pypi.org/project/streamlit/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment