Download app.py from munta/weee: direct link, hf CLI and curl.
- Browser
- Download file 548 Bytes
-
https://huggingface.co/spaces/munta/weee/resolve/main/app.py
- Command line
-
hf download hf://spaces/munta/weee/app.py
-
curl -L -o app.py https://huggingface.co/spaces/munta/weee/resolve/main/app.py
548 Bytes
| import streamlit as st | |
| from sklearn import neighbors, datasets | |
| with st.form(key='my_form'): | |
| sLen = st.slider('Sepal lenght(cm) ', 0.0, 10.0) | |
| sWid = st.slider('Sepal width(cm) ', 0.0, 10.0) | |
| pLen = st.slider('Petal lenght(cm) ', 0.0, 10.0) | |
| pWid = st.slider('Petal width(cm) ', 0.0, 10.0) | |
| st.form_submit_button('Predict') | |
| iris = datasets.load_iris() | |
| X,y = iris.data, iris.target | |
| knn = neighbors.KNeighborsClassifier(n_neighbors=3) #k = 3,4,5,6 | |
| knn.fit(X,y) | |
| predict = knn.predict([[sLen,sWid,pLen,pWid]]) | |
| st.text(iris.target_names[predict]) |