# -*- coding: utf-8 -*-
"""IRIS Pred WebApp.py

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1ulmv6b2l38iGBDvoBQCpNUtnnpaKGw4i
"""

import streamlit as st
import pickle

dtree_model=pickle.load(open('/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/dtree_model.pk','rb'))
log_model=pickle.load(open('/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/log_model.pk','rb'))
svm_model=pickle.load(open('/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/svm_model.pk','rb'))

def classify(num):
    if num<0.5:
        return 'Setosa'
    elif num <1.5:
        return 'Versicolor'
    else:
        return 'Virginica'
def main():
    st.title("Streamlit Tutorial")
    html_temp = """
    <div style="background-color:teal ;padding:10px">
    <h2 style="color:white;text-align:center;">Iris Classification</h2>
    </div>
    """
    st.markdown(html_temp, unsafe_allow_html=True)
    activities=['Decision Tree','Logistic Regression','SVM']
    option=st.sidebar.selectbox('Which model would you like to use?',activities)
    st.subheader(option)
    sl=st.slider('Select Sepal Length', 0.0, 10.0)
    sw=st.slider('Select Sepal Width', 0.0, 10.0)
    pl=st.slider('Select Petal Length', 0.0, 10.0)
    pw=st.slider('Select Petal Width', 0.0, 10.0)
    inputs=[[sl,sw,pl,pw]]
    if st.button('Classify'):
        if option=='Decision Tree':
            st.success(classify(dtree_model.predict(inputs)))
        elif option=='Logistic Regression':
            st.success(classify(log_model.predict(inputs)))
        else:
           st.success(classify(svm_model.predict(inputs)))


if __name__=='__main__':
    main()
536382a56434134cd950aad6d1907878ec46d360
<mask token>


def classify(num):
    if num < 0.5:
        return 'Setosa'
    elif num < 1.5:
        return 'Versicolor'
    else:
        return 'Virginica'


def main():
    st.title('Streamlit Tutorial')
    html_temp = """
    <div style="background-color:teal ;padding:10px">
    <h2 style="color:white;text-align:center;">Iris Classification</h2>
    </div>
    """
    st.markdown(html_temp, unsafe_allow_html=True)
    activities = ['Decision Tree', 'Logistic Regression', 'SVM']
    option = st.sidebar.selectbox('Which model would you like to use?',
        activities)
    st.subheader(option)
    sl = st.slider('Select Sepal Length', 0.0, 10.0)
    sw = st.slider('Select Sepal Width', 0.0, 10.0)
    pl = st.slider('Select Petal Length', 0.0, 10.0)
    pw = st.slider('Select Petal Width', 0.0, 10.0)
    inputs = [[sl, sw, pl, pw]]
    if st.button('Classify'):
        if option == 'Decision Tree':
            st.success(classify(dtree_model.predict(inputs)))
        elif option == 'Logistic Regression':
            st.success(classify(log_model.predict(inputs)))
        else:
            st.success(classify(svm_model.predict(inputs)))


<mask token>

<mask token>


def classify(num):
    if num < 0.5:
        return 'Setosa'
    elif num < 1.5:
        return 'Versicolor'
    else:
        return 'Virginica'


def main():
    st.title('Streamlit Tutorial')
    html_temp = """
    <div style="background-color:teal ;padding:10px">
    <h2 style="color:white;text-align:center;">Iris Classification</h2>
    </div>
    """
    st.markdown(html_temp, unsafe_allow_html=True)
    activities = ['Decision Tree', 'Logistic Regression', 'SVM']
    option = st.sidebar.selectbox('Which model would you like to use?',
        activities)
    st.subheader(option)
    sl = st.slider('Select Sepal Length', 0.0, 10.0)
    sw = st.slider('Select Sepal Width', 0.0, 10.0)
    pl = st.slider('Select Petal Length', 0.0, 10.0)
    pw = st.slider('Select Petal Width', 0.0, 10.0)
    inputs = [[sl, sw, pl, pw]]
    if st.button('Classify'):
        if option == 'Decision Tree':
            st.success(classify(dtree_model.predict(inputs)))
        elif option == 'Logistic Regression':
            st.success(classify(log_model.predict(inputs)))
        else:
            st.success(classify(svm_model.predict(inputs)))


if __name__ == '__main__':
    main()

<mask token>
dtree_model = pickle.load(open(
    '/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/dtree_model.pk'
    , 'rb'))
log_model = pickle.load(open(
    '/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/log_model.pk'
    , 'rb'))
svm_model = pickle.load(open(
    '/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/svm_model.pk'
    , 'rb'))


def classify(num):
    if num < 0.5:
        return 'Setosa'
    elif num < 1.5:
        return 'Versicolor'
    else:
        return 'Virginica'


def main():
    st.title('Streamlit Tutorial')
    html_temp = """
    <div style="background-color:teal ;padding:10px">
    <h2 style="color:white;text-align:center;">Iris Classification</h2>
    </div>
    """
    st.markdown(html_temp, unsafe_allow_html=True)
    activities = ['Decision Tree', 'Logistic Regression', 'SVM']
    option = st.sidebar.selectbox('Which model would you like to use?',
        activities)
    st.subheader(option)
    sl = st.slider('Select Sepal Length', 0.0, 10.0)
    sw = st.slider('Select Sepal Width', 0.0, 10.0)
    pl = st.slider('Select Petal Length', 0.0, 10.0)
    pw = st.slider('Select Petal Width', 0.0, 10.0)
    inputs = [[sl, sw, pl, pw]]
    if st.button('Classify'):
        if option == 'Decision Tree':
            st.success(classify(dtree_model.predict(inputs)))
        elif option == 'Logistic Regression':
            st.success(classify(log_model.predict(inputs)))
        else:
            st.success(classify(svm_model.predict(inputs)))


if __name__ == '__main__':
    main()

<mask token>
import streamlit as st
import pickle
dtree_model = pickle.load(open(
    '/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/dtree_model.pk'
    , 'rb'))
log_model = pickle.load(open(
    '/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/log_model.pk'
    , 'rb'))
svm_model = pickle.load(open(
    '/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/svm_model.pk'
    , 'rb'))


def classify(num):
    if num < 0.5:
        return 'Setosa'
    elif num < 1.5:
        return 'Versicolor'
    else:
        return 'Virginica'


def main():
    st.title('Streamlit Tutorial')
    html_temp = """
    <div style="background-color:teal ;padding:10px">
    <h2 style="color:white;text-align:center;">Iris Classification</h2>
    </div>
    """
    st.markdown(html_temp, unsafe_allow_html=True)
    activities = ['Decision Tree', 'Logistic Regression', 'SVM']
    option = st.sidebar.selectbox('Which model would you like to use?',
        activities)
    st.subheader(option)
    sl = st.slider('Select Sepal Length', 0.0, 10.0)
    sw = st.slider('Select Sepal Width', 0.0, 10.0)
    pl = st.slider('Select Petal Length', 0.0, 10.0)
    pw = st.slider('Select Petal Width', 0.0, 10.0)
    inputs = [[sl, sw, pl, pw]]
    if st.button('Classify'):
        if option == 'Decision Tree':
            st.success(classify(dtree_model.predict(inputs)))
        elif option == 'Logistic Regression':
            st.success(classify(log_model.predict(inputs)))
        else:
            st.success(classify(svm_model.predict(inputs)))


if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-
"""IRIS Pred WebApp.py

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1ulmv6b2l38iGBDvoBQCpNUtnnpaKGw4i
"""

import streamlit as st
import pickle

dtree_model=pickle.load(open('/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/dtree_model.pk','rb'))
log_model=pickle.load(open('/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/log_model.pk','rb'))
svm_model=pickle.load(open('/content/drive/My Drive/PythonBoss/ML Project/IRIS Predicion WebAPP/svm_model.pk','rb'))

def classify(num):
    if num<0.5:
        return 'Setosa'
    elif num <1.5:
        return 'Versicolor'
    else:
        return 'Virginica'
def main():
    st.title("Streamlit Tutorial")
    html_temp = """
    <div style="background-color:teal ;padding:10px">
    <h2 style="color:white;text-align:center;">Iris Classification</h2>
    </div>
    """
    st.markdown(html_temp, unsafe_allow_html=True)
    activities=['Decision Tree','Logistic Regression','SVM']
    option=st.sidebar.selectbox('Which model would you like to use?',activities)
    st.subheader(option)
    sl=st.slider('Select Sepal Length', 0.0, 10.0)
    sw=st.slider('Select Sepal Width', 0.0, 10.0)
    pl=st.slider('Select Petal Length', 0.0, 10.0)
    pw=st.slider('Select Petal Width', 0.0, 10.0)
    inputs=[[sl,sw,pl,pw]]
    if st.button('Classify'):
        if option=='Decision Tree':
            st.success(classify(dtree_model.predict(inputs)))
        elif option=='Logistic Regression':
            st.success(classify(log_model.predict(inputs)))
        else:
           st.success(classify(svm_model.predict(inputs)))


if __name__=='__main__':
    main()