aangel commited on
Commit
13ce55a
·
1 Parent(s): e9f13b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -2,7 +2,14 @@ import streamlit as st
2
 
3
  with st.form(key='my_form'):
4
  sLen = st.slider('sepal lenght(cm)', 0.0, 10.0)
5
- sLen = st.slider('sepal width(cm)', 0.0, 10.0)
6
- sLen = st.slider('petal lenght(cm)', 0.0, 10.0)
7
- sLen = st.slider('petal width(cm)', 0.0, 10.0)
8
- st.form_submit_button('Predict')
 
 
 
 
 
 
 
 
2
 
3
  with st.form(key='my_form'):
4
  sLen = st.slider('sepal lenght(cm)', 0.0, 10.0)
5
+ sWid = st.slider('sepal width(cm)', 0.0, 10.0)
6
+ pLen = st.slider('petal lenght(cm)', 0.0, 10.0)
7
+ pWid = st.slider('petal width(cm)', 0.0, 10.0)
8
+ st.form_submit_button('Predict')
9
+
10
+ iris = datasets.load_iris()
11
+ x,y = iris.data, iris.target
12
+ knn = neighbors.KNeighborsClassifier(n_neighbors=4)
13
+ knn.fit(x,y)
14
+ Predict = knn.predict([[sLen,sWid,pLen,pWid]])
15
+ print(iris.target_names[knn.predict([[3,5,4,2]])])