Amittripipathi commited on
Commit
88a72d6
·
verified ·
1 Parent(s): 9709cce

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +5 -5
src/streamlit_app.py CHANGED
@@ -46,13 +46,13 @@ input_df = pd.DataFrame(input_data)
46
 
47
  # Custom transformer to replace 'reg' with 'Regular' in Product_Sugar_Content
48
  class SugarContentReplacer(BaseEstimator, TransformerMixin):
49
- def fit(self, X, y=None):
50
  return self
51
 
52
- def transform(self, X):
53
- X = X.copy()
54
- X['Product_Sugar_Content'] = X['Product_Sugar_Content'].replace('reg', 'Regular')
55
- return X
56
 
57
  # Add get_feature_names_out method
58
  def get_feature_names_out(self, input_features=None):
 
46
 
47
  # Custom transformer to replace 'reg' with 'Regular' in Product_Sugar_Content
48
  class SugarContentReplacer(BaseEstimator, TransformerMixin):
49
+ def fit(self, input_df, y=None):
50
  return self
51
 
52
+ def transform(self, input_df):
53
+ input_df = input_df.copy()
54
+ input_df['Product_Sugar_Content'] = input_df['Product_Sugar_Content'].replace('reg', 'Regular')
55
+ return input_df
56
 
57
  # Add get_feature_names_out method
58
  def get_feature_names_out(self, input_features=None):