hidevscommunity's picture
Create app.py
7457c6c verified
import streamlit as st
import numpy as np
import pickle
import streamlit.components.v1 as components
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
# Load the pickled model
def load_model():
return pickle.load(open('Startup_Success_Rate_Pred_ra.pkl', 'rb'))
# Function for model prediction
def model_prediction(model, features):
predicted = str(model.predict(features)[0])
return predicted
def transform(text):
text = le.fit_transform(text)
return text[0]
def app_design():
# Add input fields for High, Open, and Low values
image = '34.png'
st.image(image, use_column_width=True)
st.subheader("Enter the following values:")
state_code = st.text_input("State Code")
state_code = transform([state_code])
name = st.text_input("Name")
name = transform([name])
labels = st.number_input("Labels")
founded_at = st.text_input("Founded At (DD/MM/YYY)")
founded_at = transform([founded_at])
closed_at = st.text_input("Closed At (DD/MM/YYYY)")
closed_at = transform([closed_at])
category_code = st.text_input("Category Code")
category_code = transform([category_code])
is_mobile = st.selectbox("Is Mobile Startup",('Yes','No'))
if is_mobile == 'Yes':
is_mobile = 1
else:
is_mobile = 0
is_gamesvideo = st.selectbox("Is Video Games Startup",('Yes','No'))
if is_gamesvideo == 'Yes':
is_gamesvideo = 1
else:
is_gamesvideo = 0
# Create a feature list from the user inputs
features = [[state_code, name, labels, founded_at, closed_at, category_code, is_mobile,is_gamesvideo]]
# Load the model
model = load_model()
# Make a prediction when the user clicks the "Predict" button
if st.button('Predict Success Rate'):
predicted_value = model_prediction(model, features)
if predicted_value=='1':
st.success("The Startup will close")
else:
st.success("The Startup will not close")
def about_hidevs():
components.html("""
<div>
<h4>🚀 Unlock Your Dream Job with HiDevs Community!</h4>
<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>
<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>
<p class="subtitle">🆓 Best of all, everything we offer is <b>completely free</b>! We are dedicated to helping society.</p>
<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>
<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>
<p class="subtitle">💡 Join us now, and turbocharge your career!</p>
<p class="subtitle"><a class="link" href="https://hidevscommunity.wixsite.com/hidevs" target="__blank">Website</a>
<a class="link" href="https://www.youtube.com/@HidevsCommunity1307/" target="__blank">YouTube</a>
<a class="link" href="https://www.instagram.com/hidevs_community/" target="__blank">Instagram</a>
<a class="link" href="https://medium.com/@hidevscommunity" target="__blank">Medium</a>
<a class="link" href="https://www.linkedin.com/company/hidevs-community/" target="__blank">LinkedIn</a>
<a class="link" href="https://github.com/hidevscommunity" target="__blank">GitHub</a></p>
</div>
""",
height=600)
def main():
# Set the app title and add your website name and logo
st.set_page_config(
page_title="Startup Success Rate Predication",
page_icon=":chart_with_upwards_trend:",
)
st.title("Welcome to our Startup Success Rate Predication App!")
app_design()
st.header("About HiDevs Community")
about_hidevs()
if __name__ == '__main__':
main()