eDNA / README.md
Sordhiq's picture
Update README.md
a5df65d verified
|
raw
history blame
2.09 kB

import numpy as np import pickle import pandas as pd #import streamlit as st import gradio as gr

with open("DTHabitatClassifier.pkl","rb") as pickle_in: classifier=pickle.load(pickle_in)

def welcome(): return "Welcome All"

def habitat(species, processid, marker_code, gb_acs, nucraw , levenshtein_distance):

"""Let's load in the features as argument 
This is using docstrings for specifications.
---
parameters:  
  - name: species
    in: query
    type: number
    required: true
  - name: processid
    in: query
    type: number
    required: true
  - name: marker_code
    in: query
    type: number
    required: true
  - name: gb_acs
    in: query
    type: number
    required: true
  - name: nucraw
    in: query
    type: number
    required: true
    - name: levenshtein_distance
    in: query
    type: number
    required: true
responses:
    200:
        description: The output values
    
"""

prediction=classifier.predict([[species, processid,	marker_code, gb_acs, nucraw, levenshtein_distance]])
print(prediction)
return prediction

def main(): st.title("eDNA Habitat Classification") html_temp = """

eDNA Habitat Classification App

"""

"""Proudly, Team SpaceM!"""


st.markdown(html_temp,unsafe_allow_html=True)
species = st.text_input("Species")
processid = st.text_input("Processid")
marker_code = st.text_input("Marker Code")
gb_acs = st.text_input("GB_ACS")
nucraw = st.text_input("Nucraw")
levenshtein_distance = st.text_input("Levenshtein Distance")
result=""
if st.button("Classify"):
    result=habitat(species, processid,	marker_code, gb_acs, nucraw, levenshtein_distance)
st.success(f'The output is {result}')
if st.button("About"):
    st.text("Many thanks")

if name=='main': main()