Update app.py
Browse files
app.py
CHANGED
@@ -255,8 +255,6 @@ def predict():
|
|
255 |
def process_dataframe(df):
|
256 |
try:
|
257 |
|
258 |
-
df[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']]=df[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']].fillna("NA")
|
259 |
-
|
260 |
# Define the columns needed for two parts.
|
261 |
required_columns = ['Tag', 'EngCts', 'EngShp', 'EngQua', 'EngCol', 'EngCut', 'EngPol',
|
262 |
'EngSym', 'EngFlo', 'EngNts', 'EngMikly', 'EngBlk', 'EngWht', 'EngOpen',
|
@@ -267,6 +265,7 @@ def process_dataframe(df):
|
|
267 |
# Create two DataFrames: one for prediction and one for classification.
|
268 |
df_pred = df[required_columns].copy()
|
269 |
df_pred = df_pred[(df_pred[['EngCts']] > 0.00).all(axis=1) & (df_pred[['EngCts']] <= 0.99).all(axis=1)]
|
|
|
270 |
df_class = df[required_columns_2].fillna("NA").copy()
|
271 |
|
272 |
# Transform categorical columns for prediction DataFrame using the label encoders.
|
|
|
255 |
def process_dataframe(df):
|
256 |
try:
|
257 |
|
|
|
|
|
258 |
# Define the columns needed for two parts.
|
259 |
required_columns = ['Tag', 'EngCts', 'EngShp', 'EngQua', 'EngCol', 'EngCut', 'EngPol',
|
260 |
'EngSym', 'EngFlo', 'EngNts', 'EngMikly', 'EngBlk', 'EngWht', 'EngOpen',
|
|
|
265 |
# Create two DataFrames: one for prediction and one for classification.
|
266 |
df_pred = df[required_columns].copy()
|
267 |
df_pred = df_pred[(df_pred[['EngCts']] > 0.00).all(axis=1) & (df_pred[['EngCts']] <= 0.99).all(axis=1)]
|
268 |
+
df_pred[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']]=df_pred[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']].fillna("NA")
|
269 |
df_class = df[required_columns_2].fillna("NA").copy()
|
270 |
|
271 |
# Transform categorical columns for prediction DataFrame using the label encoders.
|