pavanmutha commited on
Commit
48f5f7b
·
verified ·
1 Parent(s): d8739ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -182,6 +182,13 @@ def compare_models():
182
 
183
  results_df = pd.DataFrame(results)
184
  return results_df
 
 
 
 
 
 
 
185
 
186
  def train_model(_):
187
  try:
 
182
 
183
  results_df = pd.DataFrame(results)
184
  return results_df
185
+
186
+ # 1. prepare_data should come first
187
+ def prepare_data(df, target_column="target"):
188
+ from sklearn.model_selection import train_test_split
189
+ X = df.drop(columns=[target_column])
190
+ y = df[target_column]
191
+ return train_test_split(X, y, test_size=0.2, random_state=42)
192
 
193
  def train_model(_):
194
  try: