Shafanda Nabil Sembodo
commited on
Commit
·
c1f0e7d
1
Parent(s):
b40741e
repair
Browse files
app.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
| 1 |
-
import os
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd
|
| 4 |
from pycaret.classification import *
|
| 5 |
|
| 6 |
-
os.environ['TRANSFORMERS_CACHE'] = '/home/user/'
|
| 7 |
os.environ['MLFLOW_TRACKING_USERNAME'] = 'fandanabil1379'
|
| 8 |
os.environ['MLFLOW_TRACKING_PASSWORD'] = 'dadc32f6246f307c2fe4928f3074068f628b79ba'
|
| 9 |
|
| 10 |
-
@st.cache_data
|
| 11 |
def convert_df(df):
|
| 12 |
return df.to_csv(index=False).encode('utf-8')
|
| 13 |
|
|
@@ -30,12 +28,7 @@ if uploaded_file is not None:
|
|
| 30 |
# do prediction
|
| 31 |
df = pd.read_csv(uploaded_file)
|
| 32 |
model = load_model()
|
| 33 |
-
|
| 34 |
-
try:
|
| 35 |
-
prediction = predict_model(model, df).drop(columns='Unnamed: 0')
|
| 36 |
-
except:
|
| 37 |
-
os.chmod("/home/user/app/", stat.S_IRWXO)
|
| 38 |
-
prediction = predict_model(model, df).drop(columns='Unnamed: 0')
|
| 39 |
|
| 40 |
# show the result
|
| 41 |
st.write(prediction)
|
|
|
|
| 1 |
+
import os
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd
|
| 4 |
from pycaret.classification import *
|
| 5 |
|
|
|
|
| 6 |
os.environ['MLFLOW_TRACKING_USERNAME'] = 'fandanabil1379'
|
| 7 |
os.environ['MLFLOW_TRACKING_PASSWORD'] = 'dadc32f6246f307c2fe4928f3074068f628b79ba'
|
| 8 |
|
|
|
|
| 9 |
def convert_df(df):
|
| 10 |
return df.to_csv(index=False).encode('utf-8')
|
| 11 |
|
|
|
|
| 28 |
# do prediction
|
| 29 |
df = pd.read_csv(uploaded_file)
|
| 30 |
model = load_model()
|
| 31 |
+
prediction = predict_model(model, df).drop(columns='Unnamed: 0')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# show the result
|
| 34 |
st.write(prediction)
|
logs.log
CHANGED
|
@@ -51,3 +51,68 @@ Feature names unseen at fit time:
|
|
| 51 |
2023-08-02 14:14:55,425:INFO:Preloading libraries
|
| 52 |
2023-08-02 14:14:55,425:INFO:Set up data.
|
| 53 |
2023-08-02 14:14:55,430:INFO:Set up index.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
2023-08-02 14:14:55,425:INFO:Preloading libraries
|
| 52 |
2023-08-02 14:14:55,425:INFO:Set up data.
|
| 53 |
2023-08-02 14:14:55,430:INFO:Set up index.
|
| 54 |
+
2023-08-03 07:20:31,034:WARNING:
|
| 55 |
+
'cuml' is a soft dependency and not included in the pycaret installation. Please run: `pip install cuml` to install.
|
| 56 |
+
2023-08-03 07:20:31,035:WARNING:
|
| 57 |
+
'cuml' is a soft dependency and not included in the pycaret installation. Please run: `pip install cuml` to install.
|
| 58 |
+
2023-08-03 07:20:31,035:WARNING:
|
| 59 |
+
'cuml' is a soft dependency and not included in the pycaret installation. Please run: `pip install cuml` to install.
|
| 60 |
+
2023-08-03 07:20:31,035:WARNING:
|
| 61 |
+
'cuml' is a soft dependency and not included in the pycaret installation. Please run: `pip install cuml` to install.
|
| 62 |
+
2023-08-03 07:20:41,626:INFO:Initializing predict_model()
|
| 63 |
+
2023-08-03 07:20:41,626:INFO:predict_model(self=<pycaret.classification.oop.ClassificationExperiment object at 0x16da13e20>, estimator=Pipeline(memory=FastMemory(location=/var/folders/vh/81ldn_315vdf1b2_lnntkb080000gn/T/joblib),
|
| 64 |
+
steps=[('combine',
|
| 65 |
+
TransformerWrapper(transformer=TransformerWrapper(include=['ed'],
|
| 66 |
+
transformer=Combine()))),
|
| 67 |
+
('remove outlier',
|
| 68 |
+
TransformerWrapper(transformer=TransformerWrapper(transformer=RemoveOutliers(random_state=42)))),
|
| 69 |
+
('normalize',
|
| 70 |
+
TransformerWrapper(transformer=TransformerWrapper(exclude=['ed',
|
| 71 |
+
'age'],
|
| 72 |
+
transformer=RobustScaler()))),
|
| 73 |
+
('actual_estimator',
|
| 74 |
+
LogisticRegression(C=8.956999999999999,
|
| 75 |
+
class_weight='balanced', max_iter=1000,
|
| 76 |
+
random_state=42))]), probability_threshold=None, encoded_labels=False, raw_score=False, round=4, verbose=True, ml_usecase=None, preprocess=True, encode_labels=<function _SupervisedExperiment.predict_model.<locals>.encode_labels at 0x17e0d9160>)
|
| 77 |
+
2023-08-03 07:20:41,626:INFO:Checking exceptions
|
| 78 |
+
2023-08-03 07:20:41,626:INFO:Preloading libraries
|
| 79 |
+
2023-08-03 07:20:41,629:INFO:Set up data.
|
| 80 |
+
2023-08-03 07:20:41,637:INFO:Set up index.
|
| 81 |
+
2023-08-03 07:21:17,448:INFO:Initializing predict_model()
|
| 82 |
+
2023-08-03 07:21:17,449:INFO:predict_model(self=<pycaret.classification.oop.ClassificationExperiment object at 0x16dab19d0>, estimator=Pipeline(memory=FastMemory(location=/var/folders/vh/81ldn_315vdf1b2_lnntkb080000gn/T/joblib),
|
| 83 |
+
steps=[('combine',
|
| 84 |
+
TransformerWrapper(transformer=TransformerWrapper(include=['ed'],
|
| 85 |
+
transformer=Combine()))),
|
| 86 |
+
('remove outlier',
|
| 87 |
+
TransformerWrapper(transformer=TransformerWrapper(transformer=RemoveOutliers(random_state=42)))),
|
| 88 |
+
('normalize',
|
| 89 |
+
TransformerWrapper(transformer=TransformerWrapper(exclude=['ed',
|
| 90 |
+
'age'],
|
| 91 |
+
transformer=RobustScaler()))),
|
| 92 |
+
('actual_estimator',
|
| 93 |
+
LogisticRegression(C=8.956999999999999,
|
| 94 |
+
class_weight='balanced', max_iter=1000,
|
| 95 |
+
random_state=42))]), probability_threshold=None, encoded_labels=False, raw_score=False, round=4, verbose=True, ml_usecase=None, preprocess=True, encode_labels=<function _SupervisedExperiment.predict_model.<locals>.encode_labels at 0x17e0d9dc0>)
|
| 96 |
+
2023-08-03 07:21:17,449:INFO:Checking exceptions
|
| 97 |
+
2023-08-03 07:21:17,449:INFO:Preloading libraries
|
| 98 |
+
2023-08-03 07:21:17,449:INFO:Set up data.
|
| 99 |
+
2023-08-03 07:21:17,455:INFO:Set up index.
|
| 100 |
+
2023-08-03 07:22:14,797:INFO:Initializing predict_model()
|
| 101 |
+
2023-08-03 07:22:14,797:INFO:predict_model(self=<pycaret.classification.oop.ClassificationExperiment object at 0x16da4d670>, estimator=Pipeline(memory=FastMemory(location=/var/folders/vh/81ldn_315vdf1b2_lnntkb080000gn/T/joblib),
|
| 102 |
+
steps=[('combine',
|
| 103 |
+
TransformerWrapper(transformer=TransformerWrapper(include=['ed'],
|
| 104 |
+
transformer=Combine()))),
|
| 105 |
+
('remove outlier',
|
| 106 |
+
TransformerWrapper(transformer=TransformerWrapper(transformer=RemoveOutliers(random_state=42)))),
|
| 107 |
+
('normalize',
|
| 108 |
+
TransformerWrapper(transformer=TransformerWrapper(exclude=['ed',
|
| 109 |
+
'age'],
|
| 110 |
+
transformer=RobustScaler()))),
|
| 111 |
+
('actual_estimator',
|
| 112 |
+
LogisticRegression(C=8.956999999999999,
|
| 113 |
+
class_weight='balanced', max_iter=1000,
|
| 114 |
+
random_state=42))]), probability_threshold=None, encoded_labels=False, raw_score=False, round=4, verbose=True, ml_usecase=None, preprocess=True, encode_labels=<function _SupervisedExperiment.predict_model.<locals>.encode_labels at 0x16e275a60>)
|
| 115 |
+
2023-08-03 07:22:14,797:INFO:Checking exceptions
|
| 116 |
+
2023-08-03 07:22:14,797:INFO:Preloading libraries
|
| 117 |
+
2023-08-03 07:22:14,798:INFO:Set up data.
|
| 118 |
+
2023-08-03 07:22:14,801:INFO:Set up index.
|