Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- .gitattributes +1 -0
- src/charts1.jpg +3 -0
- src/eda.py +29 -0
- src/models.py +48 -0
- src/pipeline_model.pkl +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
src/charts1.jpg filter=lfs diff=lfs merge=lfs -text
|
src/charts1.jpg
ADDED
|
Git LFS Details
|
src/eda.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
+
import matplotlib.pyplot as plt
|
| 5 |
+
from phik.report import plot_correlation_matrix
|
| 6 |
+
from PIL import Image
|
| 7 |
+
|
| 8 |
+
#membuat function untuk nantinya dipanggil di app.py
|
| 9 |
+
def run():
|
| 10 |
+
st.title('Welcome to Explaration Data Analysis')
|
| 11 |
+
# #Memanggil data csv
|
| 12 |
+
# df= pd.read_csv(r'rideshare_kaggle.csv')
|
| 13 |
+
|
| 14 |
+
# #menampilakn 5 data teratas
|
| 15 |
+
# st.table(df.head(5))
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
#menampilakn phik matrix
|
| 19 |
+
st.title('phik correlation matrix')
|
| 20 |
+
image = Image.open('charts1.jpg')
|
| 21 |
+
st.image(image, caption='figure 1')
|
| 22 |
+
|
| 23 |
+
#menampilkan penjelasan
|
| 24 |
+
with st.expander('Explanation'):
|
| 25 |
+
st.caption('lorem ipsum')
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
src/models.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import pickle
|
| 4 |
+
from PIL import Image
|
| 5 |
+
|
| 6 |
+
def run():
|
| 7 |
+
# Load All Files
|
| 8 |
+
|
| 9 |
+
with open('pipeline_model.pkl', 'rb') as file:
|
| 10 |
+
full_process = pickle.load(file)
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
distance = st.number_input(label='input your distance here',min_value=0.0,max_value=7.5)
|
| 14 |
+
surge_multiplier = st.selectbox(label='choose your surge_multiplier here',options=[1. , 1.25, 2.5 , 2. , 1.75, 1.5 , 3. ])
|
| 15 |
+
name = st.selectbox(label='choose your cab name here',options=['Shared', 'Lux', 'Lyft', 'Lux Black XL', 'Lyft XL', 'Lux Black',
|
| 16 |
+
'UberXL', 'Black', 'UberX', 'WAV', 'Black SUV', 'UberPool'])
|
| 17 |
+
product_id = st.selectbox(label='choose your product id here',options=['lyft_line', 'lyft_premier', 'lyft', 'lyft_luxsuv', 'lyft_plus',
|
| 18 |
+
'lyft_lux', 'uber_line', 'uber_premier', 'uber', 'uber_luxsuv',
|
| 19 |
+
'uber_plus', 'uber_lux'])
|
| 20 |
+
|
| 21 |
+
st.write('In the following is the result of the data you have input : ')
|
| 22 |
+
|
| 23 |
+
data_inf = pd.DataFrame({
|
| 24 |
+
'distance' : distance,
|
| 25 |
+
'surge_multiplier' : surge_multiplier,
|
| 26 |
+
'name' : name ,
|
| 27 |
+
'product_id' : product_id,
|
| 28 |
+
}, index=[0])
|
| 29 |
+
|
| 30 |
+
st.table(data_inf)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
if st.button(label='predict'):
|
| 34 |
+
|
| 35 |
+
# Melakukan prediksi data dummy
|
| 36 |
+
y_pred_inf = full_process.predict(data_inf)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
st.metric(label="Here is a prediction of your travel costs : ", value = y_pred_inf[0])
|
| 40 |
+
|
| 41 |
+
# If your data is a classification, you can follow the example below
|
| 42 |
+
# if y_pred_inf[0] == 0:
|
| 43 |
+
# st.write('Pasien tidak terkena jantung')
|
| 44 |
+
# st.markdown("[Cara Cegah Serangan Jantung](https://www.siloamhospitals.com/informasi-siloam/artikel/cara-cegah-serangan-jantung-di-usia-muda)")
|
| 45 |
+
|
| 46 |
+
# else:
|
| 47 |
+
# st.write('Pasien kemungkinan terkena jantung')
|
| 48 |
+
# st.markdown("[Cara Hidup Sehat Sehabis Terkena Serangan Jantung](https://lifestyle.kompas.com/read/2021/11/09/101744620/7-pola-hidup-sehat-setelah-mengalami-serangan-jantung?page=all)")
|
src/pipeline_model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f9376ef7f21c5852bd0495963a0f41a34f34fb18174f2fa45667da8d931e56a4
|
| 3 |
+
size 2648
|