text: import streamlit as st
  import streamlit.components.v1 as components
  import pandas as pd
  import numpy as np
  import pickle
  from sklearn.ensemble import RandomForestClassifier
  
  st.set_page_config(layout="wide")
  
  st.header('Penguin Island Prediction Application (Random Forest Classifier)')
  
  with st.beta_container():
   #navbar 
  #https://bootsnipp.com/snippets/nNX3a     https://www.mockplus.com/blog/post/bootstrap-navbar-template
     components.html(
         """
         <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
  <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <!------ Include the above in your HEAD tag ---------->
  
  <nav class="navbar navbar-icon-top navbar-expand-lg navbar-dark bg-dark" >
    <a class="navbar-brand" href="https://www.rstiwari.com" target="_blank">Profile</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
  
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav mr-auto">
        <li class="nav-item active">
          <a class="nav-link" href=" https://tiwari11-rst.medium.com/" target="_blank">
            <i class="fa fa-home"></i>
            Medium
            <span class="sr-only">(current)</span>
            </a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href=" https://happyman11.github.io/" target="_blank">
            <i class="fa fa-envelope-o">
              <span class="badge badge-danger">Git Pages</span>
            </i>
           
          </a>
        </li>
        
          <li class="nav-item">
          <a class="nav-link" href="https://happyman11.github.io/" target="_blank">
            <i class="fa fa-globe">
              <span class="badge badge-success">Badges</span>
            </i>
           
          </a>
        </li>
            
          </a>
        </li>
        
        <li class="nav-item">
          <a class="nav-link disabled" href="https://ravishekhartiwari.blogspot.com/" target="_blank">
            <i class="fa fa-envelope-o">
              <span class="badge badge-warning">Blogspot</span>
            </i>
            
          </a>
        </li>
        
        
      </ul>
    
      
    </div>
  </nav>
         """, height=70,
      )
  
  st.sidebar.header('User Input Features')
  
  st.sidebar.markdown("""
  [Example CSV input file](https://raw.githubusercontent.com/dataprofessor/data/master/penguins_example.csv)
  """)
  
  
  uploaded_file = st.sidebar.file_uploader("Upload your input CSV file", type=["csv"])
  if uploaded_file is not None:
      input_df = pd.read_csv(uploaded_file)
  else:
      def user_input_features():
          island = st.sidebar.selectbox('Island',('Biscoe','Dream','Torgersen'))
          sex = st.sidebar.selectbox('Sex',('male','female'))
          bill_length_mm = st.sidebar.slider('Bill length (mm)', 32.1,59.6,43.9)
          bill_depth_mm = st.sidebar.slider('Bill depth (mm)', 13.1,21.5,17.2)
          flipper_length_mm = st.sidebar.slider('Flipper length (mm)', 172.0,231.0,201.0)
          body_mass_g = st.sidebar.slider('Body mass (g)', 2700.0,6300.0,4207.0)
          data = {'island': island,
                  'bill_length_mm': bill_length_mm,
                  'bill_depth_mm': bill_depth_mm,
                  'flipper_length_mm': flipper_length_mm,
                  'body_mass_g': body_mass_g,
                  'sex': sex}
          features = pd.DataFrame(data, index=[0])
          return features
      input_df = user_input_features()
  
  
  penguins_raw = pd.read_csv('penguins_cleaned.csv')
  penguins = penguins_raw.drop(columns=['species'])
  df = pd.concat([input_df,penguins],axis=0)
  
  # Encoding of ordinal features
  # https://www.kaggle.com/pratik1120/penguin-dataset-eda-classification-and-clustering
  encode = ['sex','island']
  for col in encode:
      dummy = pd.get_dummies(df[col], prefix=col)
      df = pd.concat([df,dummy], axis=1)
      del df[col]
  df = df[:1] # Selects only the first row (the user input data)
  
  # Displays the user input features
  st.subheader('User Input features Sample')
  
  if uploaded_file is not None:
      st.write(df)
  else:
      st.write('Awaiting CSV file to be uploaded. Currently using example input parameters (shown below).')
      st.write(df)
  
  # Reads in saved classification model
  load_clf = pickle.load(open('penguins_clf.pkl', 'rb'))
  
  # Apply model to make predictions
  prediction = load_clf.predict(df)
  prediction_proba = load_clf.predict_proba(df)
  
  
  st.subheader('Prediction')
  penguins_species = np.array(['Adelie','Chinstrap','Gentoo'])
  st.write(penguins_species[prediction])
  
  st.subheader('Prediction Probability')
  st.write(prediction_proba)
  
  with st.beta_container():
      components.html(
       """
       <div style="position: fixed;
     left: 0;
     bottom: 0;
     width: 100%;
     background-color: black;
     color: white;
     text-align: center;">
    <p>Ravi Shekhar Tiwari</p>
  </div>
       """,height=140,)
  
  