hidevscommunity commited on
Commit
143113e
·
1 Parent(s): b40ebc2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +83 -0
app.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import numpy as np
3
+ import pickle
4
+ import streamlit.components.v1 as components
5
+
6
+ # Load the pickled model
7
+ def load_model():
8
+ return pickle.load(open('Iris_Flower_Classification_RandomForest.pkl', 'rb'))
9
+
10
+ # Function for model prediction
11
+ def model_prediction(model, features):
12
+ predicted = str(model.predict(features)[0])
13
+ return predicted
14
+
15
+ def app_design():
16
+ # Add input fields for High, Open, and Low values
17
+ image = '21.png'
18
+ st.image(image, use_column_width=True)
19
+
20
+ st.subheader("Enter the following values:")
21
+
22
+ sepal_length = st.number_input("Sepal Length")
23
+ sepal_width = st.number_input("Sepal Width")
24
+ petal_length = st.number_input("Petal Length")
25
+ petal_width = st.number_input("Petal Width")
26
+
27
+
28
+
29
+ # Create a feature list from the user inputs
30
+ features = [[sepal_length, sepal_width, petal_length, petal_width]]
31
+
32
+ # Load the model
33
+ model = load_model()
34
+
35
+ # Make a prediction when the user clicks the "Predict" button
36
+ if st.button('Predict Iris Flower Classification'):
37
+ predicted_value = model_prediction(model, features)
38
+ if predicted_value == 0:
39
+ st.success("The Flower species is Setosa")
40
+ elif predicted_value == 1:
41
+ st.success("The Flower species is Versicolor")
42
+ else:
43
+ st.success("The Flower species is Virginica")
44
+
45
+
46
+
47
+ def about_hidevs():
48
+
49
+ components.html("""
50
+ <div>
51
+ <h4>🚀 Unlock Your Dream Job with HiDevs Community!</h4>
52
+ <p class="subtitle">🔍 Seeking the perfect job? HiDevs Community is your gateway to career success in the tech industry. Explore free expert courses, job-seeking support, and career transformation tips.</p>
53
+ <p class="subtitle">💼 We offer an upskill program in <b>Gen AI, Data Science, Machine Learning</b>, and assist startups in adopting <b>Gen AI</b> at minimal development costs.</p>
54
+ <p class="subtitle">🆓 Best of all, everything we offer is <b>completely free</b>! We are dedicated to helping society.</p>
55
+ <p class="subtitle">Book free of cost 1:1 mentorship on any topic of your choice — <a class="link" href="https://topmate.io/deepakchawla1307">topmate</a></p>
56
+ <p class="subtitle">✨ We dedicate over 30 minutes to each applicant’s resume, LinkedIn profile, mock interview, and upskill program. If you’d like our guidance, check out our services <a class="link" href="https://hidevscommunity.wixsite.com/hidevs">here</a></p>
57
+ <p class="subtitle">💡 Join us now, and turbocharge your career!</p>
58
+ <p class="subtitle"><a class="link" href="https://hidevscommunity.wixsite.com/hidevs" target="__blank">Website</a>
59
+ <a class="link" href="https://www.youtube.com/@HidevsCommunity1307/" target="__blank">YouTube</a>
60
+ <a class="link" href="https://www.instagram.com/hidevs_community/" target="__blank">Instagram</a>
61
+ <a class="link" href="https://medium.com/@hidevscommunity" target="__blank">Medium</a>
62
+ <a class="link" href="https://www.linkedin.com/company/hidevs-community/" target="__blank">LinkedIn</a>
63
+ <a class="link" href="https://github.com/hidevscommunity" target="__blank">GitHub</a></p>
64
+ </div>
65
+ """,
66
+ height=600)
67
+
68
+ def main():
69
+
70
+ # Set the app title and add your website name and logo
71
+ st.set_page_config(
72
+ page_title="Iris Flower Classification",
73
+ page_icon=":chart_with_upwards_trend:",
74
+ )
75
+
76
+ st.title("Welcome to our Iris Flower Classification App!")
77
+
78
+ app_design()
79
+ st.header("About HiDevs Community")
80
+ about_hidevs()
81
+
82
+ if __name__ == '__main__':
83
+ main()