Update classification_model_monitor.py
Browse files
classification_model_monitor.py
CHANGED
@@ -42,8 +42,8 @@ def get_adjusted_predictions(df):
|
|
42 |
df = df.copy()
|
43 |
df.reset_index(drop=True, inplace=True)
|
44 |
df.loc[df['y_pred_proba']<CLASSIFIER_ADJUSTMENT_THRESHOLD, 'y_pred'] = 'NATION'
|
45 |
-
df.loc[(df['text'].str.contains('Pakistan')) & (df['y_pred'] == 'NATION'), 'y_pred'] = 'WORLD'
|
46 |
-
df.loc[(df['text'].str.contains('Zodiac Sign', case=False)) | (df['text'].str.contains('Horoscope', case=False)), 'y_pred'] = 'SCIENCE'
|
47 |
logging.info("Exiting get_adjusted_predictions()")
|
48 |
return df
|
49 |
except Exception as e:
|
|
|
42 |
df = df.copy()
|
43 |
df.reset_index(drop=True, inplace=True)
|
44 |
df.loc[df['y_pred_proba']<CLASSIFIER_ADJUSTMENT_THRESHOLD, 'y_pred'] = 'NATION'
|
45 |
+
# df.loc[(df['text'].str.contains('Pakistan')) & (df['y_pred'] == 'NATION'), 'y_pred'] = 'WORLD'
|
46 |
+
# df.loc[(df['text'].str.contains('Zodiac Sign', case=False)) | (df['text'].str.contains('Horoscope', case=False)), 'y_pred'] = 'SCIENCE'
|
47 |
logging.info("Exiting get_adjusted_predictions()")
|
48 |
return df
|
49 |
except Exception as e:
|