-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
26 lines (20 loc) · 802 Bytes
/
app.py
File metadata and controls
26 lines (20 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import joblib
import streamlit as st
model = joblib.load('customer_segmentation')
if __name__ == '__main__':
st.title('Customer Segmentation tool')
X = st.number_input('Enter Annual Income: ')
Y = st.number_input('Enter Spending Score: ')
Z = st.button('Predict')
if Z:
A = model.predict([[X,Y]])
if A == [0]:
st.info('Customer with medium Annual Income and Spending')
elif A == [1]:
st.info('Customer with High Annual Income and Spending')
elif A == [2]:
st.info('Customer with Low Annual Income and High Spending')
elif A == [3]:
st.info('Customer with High Annual Income and Low Spending')
elif A == [4]:
st.info('Customer with Low Annual Income and Spending')