MatCod commited on
Commit
fdf987c
·
verified ·
1 Parent(s): 47d96da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -181,9 +181,9 @@ class EnergyMLPredictor:
181
  'extracao_forno': extracao_val,
182
  'porcentagem_caco': item['porcentagem_caco'],
183
  'cor': item['cor'].lower(),
184
- 'prod_e': 1,
185
- 'prod_l': 1,
186
- 'autoclave': 1,
187
  'week_day': date_obj.weekday(),
188
  'month': date_obj.month,
189
  'quarter': (date_obj.month - 1) // 3 + 1,
@@ -239,10 +239,10 @@ class EnergyMLPredictor:
239
  'month': date_obj.month,
240
  'quarter': (date_obj.month - 1) // 3 + 1,
241
  'week_of_year': date_obj.isocalendar()[1],
242
- 'prod_e': 1,
243
- 'prod_l': 1,
244
  'is_weekend': int(date_obj.weekday() >= 5),
245
- 'autoclave': 1
246
  }
247
 
248
  # Encode categorical features
@@ -310,7 +310,10 @@ energy_example = """[
310
  "cor": "incolor",
311
  "espessura": 10,
312
  "extracao_forno": "651,6",
313
- "porcentagem_caco": 10.0
 
 
 
314
  }
315
  ]"""
316
 
 
181
  'extracao_forno': extracao_val,
182
  'porcentagem_caco': item['porcentagem_caco'],
183
  'cor': item['cor'].lower(),
184
+ 'prod_e': item.get('prod_e', 1),
185
+ 'prod_l': item.get('prod_l', 1),
186
+ 'autoclave': item.get('autoclave', 1),
187
  'week_day': date_obj.weekday(),
188
  'month': date_obj.month,
189
  'quarter': (date_obj.month - 1) // 3 + 1,
 
239
  'month': date_obj.month,
240
  'quarter': (date_obj.month - 1) // 3 + 1,
241
  'week_of_year': date_obj.isocalendar()[1],
242
+ 'prod_e': item.get('prod_e', 1),
243
+ 'prod_l': item.get('prod_l', 1),
244
  'is_weekend': int(date_obj.weekday() >= 5),
245
+ 'autoclave': item.get('autoclave', 1)
246
  }
247
 
248
  # Encode categorical features
 
310
  "cor": "incolor",
311
  "espessura": 10,
312
  "extracao_forno": "651,6",
313
+ "porcentagem_caco": 10.0,
314
+ "prod_e": 1,
315
+ "prod_l": 1,
316
+ "autoclave": 1
317
  }
318
  ]"""
319