File size: 2,089 Bytes
042b667
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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 = """
    <div style="background-color:tomato;padding:10px">
    <h2 style="color:white;text-align:center;">eDNA Habitat Classification App </h2>
    </div>
    """
        
    """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()