Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@ 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():
|
|
@@ -16,19 +18,27 @@ def app_design():
|
|
| 16 |
# Add input fields for High, Open, and Low values
|
| 17 |
image = '17.png'
|
| 18 |
st.image(image, use_column_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
st.subheader("Enter the following values:")
|
| 21 |
|
| 22 |
Bhk = st.number_input("Bhk")
|
| 23 |
Size = st.number_input("Size")
|
| 24 |
-
Area_Type = st.
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
Bathroom = st.number_input("Bathroom")
|
| 30 |
-
Point_of_Contact = st.
|
| 31 |
-
|
| 32 |
|
| 33 |
# Create a feature list from the user inputs
|
| 34 |
features = [[Bhk,Size,Area_Type,Area_Locality,City,Furnishing_Status,Tenant_Preferred,Bathroom,Point_of_Contact]]
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import pickle
|
| 4 |
import streamlit.components.v1 as components
|
| 5 |
+
from sklearn.preprocessing import LabelEncoder
|
| 6 |
+
le = import LabelEncoder()
|
| 7 |
|
| 8 |
# Load the pickled model
|
| 9 |
def load_model():
|
|
|
|
| 18 |
# Add input fields for High, Open, and Low values
|
| 19 |
image = '17.png'
|
| 20 |
st.image(image, use_column_width=True)
|
| 21 |
+
|
| 22 |
+
def transform(text):
|
| 23 |
+
text= le.fit_transform(text)
|
| 24 |
+
return text[0]
|
| 25 |
|
| 26 |
st.subheader("Enter the following values:")
|
| 27 |
|
| 28 |
Bhk = st.number_input("Bhk")
|
| 29 |
Size = st.number_input("Size")
|
| 30 |
+
Area_Type = st.text_input("Area Type")
|
| 31 |
+
Area_Type = transform(['Area_Type'])
|
| 32 |
+
Area_Locality = st.number_input("Area Locality")
|
| 33 |
+
City = st.text_input("City")
|
| 34 |
+
City = transform(['City'])
|
| 35 |
+
Furnishing_Status = st.text_input("Furnishing Status")
|
| 36 |
+
Furnishing_Status = transform(['Furnishing_Status'])
|
| 37 |
+
Tenant_Preferred = st.text_input("Tenant Preferred")
|
| 38 |
+
Tenant_Preferred = transform(['Tenant_Preferred'])
|
| 39 |
Bathroom = st.number_input("Bathroom")
|
| 40 |
+
Point_of_Contact = st.text_input("Point of Contact")
|
| 41 |
+
Point_of_Contact = transform(['Point_of_Contact'])
|
| 42 |
|
| 43 |
# Create a feature list from the user inputs
|
| 44 |
features = [[Bhk,Size,Area_Type,Area_Locality,City,Furnishing_Status,Tenant_Preferred,Bathroom,Point_of_Contact]]
|