Update app_star.py
Browse files- app_star.py +33 -1
app_star.py
CHANGED
@@ -28,6 +28,38 @@ def main():
|
|
28 |
st.title("My star type")
|
29 |
st.image("https://study.com/academy/lesson/star-formation-main-sequence-dwarf-giant-stars.html")
|
30 |
st.text('For comparing all models of ML It can be used for prediction')
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
if __name__=="__main__":
|
33 |
main()
|
|
|
28 |
st.title("My star type")
|
29 |
st.image("https://study.com/academy/lesson/star-formation-main-sequence-dwarf-giant-stars.html")
|
30 |
st.text('For comparing all models of ML It can be used for prediction')
|
31 |
+
with st.form("questionaire"):
|
32 |
+
K = st.slider('Temperature',min_value=1900,max_value=40000)
|
33 |
+
L = st.slider('Relative Luminosity',min_value=1900,max_value=40000)
|
34 |
+
R = st.slider('Relative Radius',min_value=1900,max_value=40000)
|
35 |
+
AM = st.slider('Absolute Magnitude',min_value=1900,max_value=40000)
|
36 |
+
CL = st.selectbox("General Color of Spectrum",options=unique_CL)
|
37 |
+
SC = st.selectbox("Spectral_Class",options=unique_SC)
|
38 |
+
|
39 |
+
clicked = st.form_submit_button("Predict type")
|
40 |
+
if clicked:
|
41 |
+
result=model.predict(pd.DataFrame({"Temperature": [K],
|
42 |
+
"Relative Luminosity": [L],
|
43 |
+
"Relative Radiusducation": [R],
|
44 |
+
"Absolute Magnitude": [AM],
|
45 |
+
"General Color of Spectrum": [CL],
|
46 |
+
"Spectral_Class": [SC]
|
47 |
+
}))
|
48 |
+
# Show prediction
|
49 |
+
if result[0] == 0:
|
50 |
+
result = "Red Dwarf"
|
51 |
+
elif result[0] == 1:
|
52 |
+
result = "Brown Dwarf"
|
53 |
+
elif result[0] == 2:
|
54 |
+
result = "White Dwarf"
|
55 |
+
elif result[0] == 3:
|
56 |
+
result = "Main Sequence"
|
57 |
+
elif result[0] == 4:
|
58 |
+
result = "Super Giants"
|
59 |
+
elif result[0] == 5:
|
60 |
+
result = "Hyper Giants"
|
61 |
+
|
62 |
+
st.success("Your finished income is "+result)
|
63 |
+
|
64 |
if __name__=="__main__":
|
65 |
main()
|