File size: 1,077 Bytes
5e90445
73b17fe
9136363
9665e55
5e90445
b46d071
5e90445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b46d071
 
 
5e90445
 
 
9870b6e
5e90445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import pickle as pkl
import streamlit as st
from sklearn.linear_model import LinearRegression
import pandas as pd



# FUNCTION
def user_report():
  Income = st.sidebar.slider('Income', 17795,107702, 18000 )
  House_age = st.sidebar.slider('House_age', 2,10, 4 )
  No_rooms = st.sidebar.slider('No_rooms', 3,11, 5 )
  population = st.sidebar.slider('population', 170,70000, 5000 )
  

  user_report_data = {
      'Income':Income,
      'House_age':House_age,
      'No_rooms':No_rooms,
      'population':population
  }
  report_data = pd.DataFrame(user_report_data, index=[0])
  return report_data




# Housing Data
user_data = user_report()
st.subheader('Housing Data')
st.write(user_data)

lr = LinearRegression()
#Open the saved file with read-binary mode
lr_pickle = pkl.load(open('linear_saved_model', 'rb'))


# MODEL
user_result = lr.predict(user_data)



# VISUALISATIONS
st.title('Visualised Housing Data')



# COLOR FUNCTION
if user_result[0]==0:
  color = 'blue'
else:
  color = 'red'



# OUTPUT
st.subheader('Price of House is : ')
st.write(str(user_result))