ttd22 commited on
Commit
c0750c9
1 Parent(s): 11bc620

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -9,7 +9,7 @@ import pandas as pd
9
 
10
 
11
  @st.experimental_memo
12
- def load_data():
13
  dataset = load_dataset("ttd22/house-price", streaming = True)
14
  df = pd.DataFrame.from_dict(dataset["train"])
15
  df = df.drop('Id', axis=1)
@@ -33,7 +33,7 @@ selected_columns = ['OverallQual', 'GrLivArea', 'TotalBsmtSF', 'YearBuilt', 'Bsm
33
  X,y = load_data(selected_columns)
34
  model = load_model(X, y)
35
 
36
- def UI(X):
37
  [OverallQual, GrLivArea, TotalBsmtSF, YearBuilt, BsmtFinSF1,
38
  GarageCars, OverallCond, LotArea, YearRemodAdd, FirstFlrSF,
39
  Fireplaces, GarageArea,OpenPorchSF, SecondFlrSF,
@@ -42,6 +42,9 @@ def UI(X):
42
  GarageCars, OverallCond, LotArea, YearRemodAdd, FirstFlrSF,
43
  Fireplaces, GarageArea,OpenPorchSF, SecondFlrSF,
44
  TotRmsAbvGrd, FullBath, HalfBath, MSSubClass, BedroomAbvGr, KitchenAbvGr]
 
 
 
45
  # Get minimum and maximum values of selected columns
46
  min_values = X.min()
47
  max_values = X.max()
@@ -52,10 +55,10 @@ def UI(X):
52
  min_val = min_values[col]
53
  max_val = max_values[col]
54
  dtype = data_types[col]
55
- features[i] = st.sidebar.slider(min_value = min_val, max_value=max_val)
56
  i +=1
57
 
58
-
59
 
60
  # MSSubClass = st.sidebar.slider("What is the building class?", min_value = 20, max_value=190)
61
  # OverallQual = st.sidebar.slider("What is the Overall material and finish quality?", min_value = 1, max_value=10)
 
9
 
10
 
11
  @st.experimental_memo
12
+ def load_data(selected_columns):
13
  dataset = load_dataset("ttd22/house-price", streaming = True)
14
  df = pd.DataFrame.from_dict(dataset["train"])
15
  df = df.drop('Id', axis=1)
 
33
  X,y = load_data(selected_columns)
34
  model = load_model(X, y)
35
 
36
+ def buil_UI(X):
37
  [OverallQual, GrLivArea, TotalBsmtSF, YearBuilt, BsmtFinSF1,
38
  GarageCars, OverallCond, LotArea, YearRemodAdd, FirstFlrSF,
39
  Fireplaces, GarageArea,OpenPorchSF, SecondFlrSF,
 
42
  GarageCars, OverallCond, LotArea, YearRemodAdd, FirstFlrSF,
43
  Fireplaces, GarageArea,OpenPorchSF, SecondFlrSF,
44
  TotRmsAbvGrd, FullBath, HalfBath, MSSubClass, BedroomAbvGr, KitchenAbvGr]
45
+ descriptions = ['What is Above grade (ground) living area square feet?',
46
+ 'What is Total square feet of basement area?',
47
+ 'What is Original construction date?','What is Type 1 finished square feet?','What is Size of garage in car capacity?','What is Overall condition rating?','What is Lot size in square feet?','What is Remodel date?','What is First Floor square feet?','What is Number of fireplaces?','What is Size of garage in square feet?','What is Open porch area in square feet?','What is Second floor square feet?','What is Total rooms above grade (does not include bathrooms)?','What is Full bathrooms above grade?','What is Half baths above grade?','What is The building class?','What is Number of bedrooms above basement level?','What is Number of kitchens?']
48
  # Get minimum and maximum values of selected columns
49
  min_values = X.min()
50
  max_values = X.max()
 
55
  min_val = min_values[col]
56
  max_val = max_values[col]
57
  dtype = data_types[col]
58
+ features[i] = st.sidebar.slider(descriptions[i],min_value = min_val, max_value=max_val)
59
  i +=1
60
 
61
+ buil_UI(X)
62
 
63
  # MSSubClass = st.sidebar.slider("What is the building class?", min_value = 20, max_value=190)
64
  # OverallQual = st.sidebar.slider("What is the Overall material and finish quality?", min_value = 1, max_value=10)