Spaces:
Build error
Build error
Commit ·
f735e2a
1
Parent(s): 22feff3
Update src/predict.py
Browse files- src/predict.py +2 -2
src/predict.py
CHANGED
|
@@ -27,7 +27,7 @@ class PredictionServices:
|
|
| 27 |
return inputs
|
| 28 |
|
| 29 |
def plot(self, pred):
|
| 30 |
-
probs = [round(pred*100,2), round(1-pred*100,2)]
|
| 31 |
labels = ['toxic', 'non-toxic']
|
| 32 |
color_map = {'toxic':"red", "non-toxic":"green"}
|
| 33 |
fig = px.bar(x=probs,
|
|
@@ -42,7 +42,7 @@ class PredictionServices:
|
|
| 42 |
fig.update_layout(yaxis_title=None,xaxis_title=None)
|
| 43 |
st.plotly_chart(fig, theme="streamlit", use_container_width=True)
|
| 44 |
|
| 45 |
-
def data_validation(data):
|
| 46 |
df = pd.read_csv(data)
|
| 47 |
status=True
|
| 48 |
for column in df.columns:
|
|
|
|
| 27 |
return inputs
|
| 28 |
|
| 29 |
def plot(self, pred):
|
| 30 |
+
probs = [round(pred*100,2), round((1-pred)*100,2)]
|
| 31 |
labels = ['toxic', 'non-toxic']
|
| 32 |
color_map = {'toxic':"red", "non-toxic":"green"}
|
| 33 |
fig = px.bar(x=probs,
|
|
|
|
| 42 |
fig.update_layout(yaxis_title=None,xaxis_title=None)
|
| 43 |
st.plotly_chart(fig, theme="streamlit", use_container_width=True)
|
| 44 |
|
| 45 |
+
def data_validation(self, data):
|
| 46 |
df = pd.read_csv(data)
|
| 47 |
status=True
|
| 48 |
for column in df.columns:
|