AUX.Ai / app.py
ujjwalmatoliya's picture
Create app.py
ea3919d verified
raw
history blame
3.97 kB
import gradio as gr
def make_prediction(age_first_funding_year, age_last_funding_year ,age_first_milestone_year ,age_last_milestone_year,
relationships, funding_rounds, funding_total_usd, milestones, is_CA, is_NY, is_MA, is_TX, is_otherstate,
is_software, is_web, is_mobile, is_enterprise, is_advertising, is_gamesvideo, is_ecommerce, is_biotech,
is_consulting, is_othercategory, has_VC, has_angel, has_roundA, has_roundB, has_roundC, has_roundD, avg_participants,
is_top500, has_RoundABCD, has_Investor, has_Seed, invalid_startup, tier_relationships):
with open("clf.pkl", "rb") as f:
clf = pickle.load(f)
preds = clf.predict([[age_first_funding_year, age_last_funding_year ,age_first_milestone_year ,age_last_milestone_year,
relationships, funding_rounds, funding_total_usd, milestones, is_CA, is_NY, is_MA, is_TX, is_otherstate,
is_software, is_web, is_mobile, is_enterprise, is_advertising, is_gamesvideo, is_ecommerce, is_biotech,
is_consulting, is_othercategory, has_VC, has_angel, has_roundA, has_roundB, has_roundC, has_roundD, avg_participants,
is_top500, has_RoundABCD, has_Investor, has_Seed, invalid_startup, tier_relationships]])
if preds == 1:
return "Your startup is likely to be successful..."
return "Your startup is not likely to be successful"
age_first_funding_year=gr.Number(label="Enter age_first_funding_year")
age_last_funding_year=gr.Number(label="Enter age_last_funding_year")
age_first_milestone_year=gr.Number(label="Enter age_first_milestone_year")
age_last_milestone_year=gr.Number(label="Enter age_last_milestone_year")
relationships=gr.Number(label="Enter relationships")
funding_rounds=gr.Number(label="Enter funding_rounds")
funding_total_usd=gr.Number(label="Enter funding_total_usd")
milestones=gr.Number(label="Enter milestones")
is_CA=gr.Number(label="is_CA")
is_NY=gr.Number(label="is_CA")
is_MA=gr.Number(label="is_MA")
is_TX=gr.Number(label="is_MA")
is_otherstate=gr.Number(label="is_otherstate")
is_software=gr.Number(label="is_software")
is_web=gr.Number(label="is_web")
is_mobile=gr.Number(label="is_mobile")
is_enterprise=gr.Number(label="is_enterprise")
is_advertising=gr.Number(label="is_advertising")
is_gamesvideo=gr.Number(label="is_gamesvideo")
is_ecommerce=gr.Number(label="is_ecommerce")
is_biotech=gr.Number(label="is_biotech=")
is_consulting=gr.Number(label="is_consulting")
is_othercategory=gr.Number(label="is_othercategory")
has_VC=gr.Number(label="Enter has_VC")
has_angel=gr.Number(label="Enter has_angel")
has_roundA=gr.Number(label="Enter has_roundA")
has_roundB=gr.Number(label="Enter has_roundB")
has_roundC=gr.Number(label="Enter has_roundC")
has_roundD=gr.Number(label="Enter has_roundD")
avg_participants=gr.Number(label="Enter avg_participants")
is_top500=gr.Number(label="Enter avg_participants")
has_RoundABCD=gr.Number(label="Enter has_roundABCD")
has_Investor=gr.Number(label="Enter has_Investor")
has_Seed=gr.Number(label="Enter has_roundABCD")
invalid_startup=gr.Number(label="Enter has_Seed")
tier_relationships=gr.Number(label="Enter Tier_relationships")
# We create the output
output = gr.Textbox()
app = gr.Interface(fn = make_prediction, inputs=[age_first_funding_year, age_last_funding_year ,age_first_milestone_year ,age_last_milestone_year,
relationships, funding_rounds, funding_total_usd, milestones, is_CA, is_NY, is_MA, is_TX, is_otherstate,
is_software, is_web, is_mobile, is_enterprise, is_advertising, is_gamesvideo, is_ecommerce, is_biotech,
is_consulting, is_othercategory, has_VC, has_angel, has_roundA, has_roundB, has_roundC, has_roundD, avg_participants,
is_top500, has_RoundABCD, has_Investor, has_Seed, invalid_startup, tier_relationships], outputs=output)
app.launch(inline=flase)