From 76921414e00d5501b874da9488b2e54dc40a8e50 Mon Sep 17 00:00:00 2001 From: utksin13 <114904343+utksin13@users.noreply.github.com> Date: Tue, 18 Oct 2022 22:12:41 +0530 Subject: [PATCH] Add files via upload --- Python/LaptopPriceApp.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Python/LaptopPriceApp.py diff --git a/Python/LaptopPriceApp.py b/Python/LaptopPriceApp.py new file mode 100644 index 0000000..1136ac9 --- /dev/null +++ b/Python/LaptopPriceApp.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +""" +Created on Fri Sep 10 18:20:12 2021 + +@author: ankit +""" + +import streamlit as st +import pickle +import numpy as np +model=pickle.load(open("model.pkl","rb")) + +def predict_price(Manufacturer,IntelCore,Ram,HDD,SSD): + prediction=model.predict([[Manufacturer,IntelCore,Ram,HDD,SSD]]) + print(prediction.round()) + return prediction + +def main(): + st.title("Streamlit Tutorial") + html_temp = """ +
+

Laptop Price Prediction ML App

+
+ """ + st.markdown(html_temp, unsafe_allow_html=True) + + Manufacturer = st.text_input("Company { HP : 0 , Lenovo : 1 , ASUS : 2 , Dell : 3 } ","") + IntelCore = st.text_input("IntelCore","") + Ram = st.text_input("Ram(gb)","") + HDD = st.text_input("HDD(gb)","") + SSD = st.text_input("SSD(gb)","") + + if st.button("Predict"): + output=predict_price(Manufacturer,IntelCore,Ram,HDD,SSD) + st.success('Laptop Price is {}'.format(output.round())) + + + +if __name__=='__main__': + main() \ No newline at end of file