ayethuzar commited on
Commit
dcf0d9b
·
unverified ·
1 Parent(s): f831fba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -1,14 +1,10 @@
1
 
2
-
3
  import streamlit as st
4
  import pandas as pd
5
  import numpy as np
6
  import pickle
7
 
8
- from sklearn.preprocessing import MinMaxScaler
9
-
10
- scaler = MinMaxScaler()
11
-
12
  np.random.seed(42)
13
 
14
  st.markdown("<body style ='color:#E2E0D9;'></body>", unsafe_allow_html=True)
@@ -20,6 +16,10 @@ st.markdown("<h5 style='text-align: center; color: #1B9E91;'>Optuna optimized LG
20
  st.write("If you want to know the numbers that you picked for some of the features such as Overall Quality, Sale Conditions etc., please check the following link")
21
  st.write("[link to the categorical encoding](https://github.com/aye-thuzar/CS634Project/edit/main/docs.md)")
22
 
 
 
 
 
23
  name_list = [
24
  'OverallQual',
25
  'YearBuilt',
@@ -104,9 +104,13 @@ data_df = pd.DataFrame.from_dict(data_df)
104
  st.write("Please adjust the feature values using the slides on the left: ")
105
  st.write(data_df.head())
106
 
107
- # normalizing the data
108
- data_df = (data_df.values - data_df.values.min()) / (data_df.values.max() - data_df.values.min())
 
 
 
109
 
 
110
  st.write(data_df)
111
 
112
  # load trained model
 
1
 
2
+ # importing libraries
3
  import streamlit as st
4
  import pandas as pd
5
  import numpy as np
6
  import pickle
7
 
 
 
 
 
8
  np.random.seed(42)
9
 
10
  st.markdown("<body style ='color:#E2E0D9;'></body>", unsafe_allow_html=True)
 
16
  st.write("If you want to know the numbers that you picked for some of the features such as Overall Quality, Sale Conditions etc., please check the following link")
17
  st.write("[link to the categorical encoding](https://github.com/aye-thuzar/CS634Project/edit/main/docs.md)")
18
 
19
+
20
+ '''
21
+ setting up the sliders and getting the input the sliders
22
+ '''
23
  name_list = [
24
  'OverallQual',
25
  'YearBuilt',
 
104
  st.write("Please adjust the feature values using the slides on the left: ")
105
  st.write(data_df.head())
106
 
107
+ '''
108
+ normalizing the data
109
+ '''
110
+ diff = np.array(min_list)-np.array(max_list)
111
+ data_df = (data_df.values - np.array(min_list)) / diff
112
 
113
+ st.write("Normalized input data")
114
  st.write(data_df)
115
 
116
  # load trained model