fendy07 commited on
Commit
5779355
·
1 Parent(s): c7d02eb

Update gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +4 -5
gradio_app.py CHANGED
@@ -1,6 +1,6 @@
1
  """
2
  HR Analytics - Gradio Deployment App
3
- Aplikasi web untuk prediksi karyawan resign menggunakan trained model
4
 
5
  Features:
6
  - Single Employee Prediction
@@ -197,8 +197,7 @@ class HRResignationPredictor:
197
  return "\n".join(recommendations)
198
 
199
  def create_gauge_chart(self, resign_prob, color):
200
- """Create gauge chart for resignation probability"""
201
-
202
  fig = go.Figure(go.Indicator(
203
  mode = "gauge+number+delta",
204
  value = resign_prob,
@@ -251,9 +250,9 @@ class HRResignationPredictor:
251
  missing_cols = [col for col in required_cols if col not in df.columns]
252
  if missing_cols:
253
  return f"❌ Missing columns: {', '.join(missing_cols)}", None
254
- # Preprocess
255
  df_processed = df.copy()
256
- # Encode categorical features
257
  for col in ['kecelakaan_kerja', 'promosi', 'divisi', 'gaji']:
258
  if col in self.encoders:
259
  # Handle unknown categories
 
1
  """
2
  HR Analytics - Gradio Deployment App
3
+ Aplikasi web untuk prediksi karyawan resign menggunakan model ML
4
 
5
  Features:
6
  - Single Employee Prediction
 
197
  return "\n".join(recommendations)
198
 
199
  def create_gauge_chart(self, resign_prob, color):
200
+ """Create gauge chart for resignation probability"""
 
201
  fig = go.Figure(go.Indicator(
202
  mode = "gauge+number+delta",
203
  value = resign_prob,
 
250
  missing_cols = [col for col in required_cols if col not in df.columns]
251
  if missing_cols:
252
  return f"❌ Missing columns: {', '.join(missing_cols)}", None
253
+ # Preprocessing
254
  df_processed = df.copy()
255
+ # Encode fitur data kategorikal
256
  for col in ['kecelakaan_kerja', 'promosi', 'divisi', 'gaji']:
257
  if col in self.encoders:
258
  # Handle unknown categories