varshitha22 commited on
Commit
a1aeb7e
·
verified ·
1 Parent(s): 6a74ea1

Update cancer.py

Browse files
Files changed (1) hide show
  1. cancer.py +3 -3
cancer.py CHANGED
@@ -33,12 +33,12 @@ def preprocess_data(df):
33
  ]), categorical_features)
34
  ], remainder='passthrough')
35
 
36
- X = df.drop('Cancer_Present', axis=1) # Drop target column
37
  y = df['Cancer_Present'] # Target column
38
- return train_test_split(X, y, test_size=0.2, random_state=23), preprocess
39
 
40
  # Train Model
41
- def train_model(X_train, y_train, preprocess, model_name):
42
  models = {
43
  'Decision Tree': DecisionTreeClassifier(),
44
  'Logistic Regression': LogisticRegression(),
 
33
  ]), categorical_features)
34
  ], remainder='passthrough')
35
 
36
+ x = df.drop('Cancer_Present', axis=1) # Drop target column
37
  y = df['Cancer_Present'] # Target column
38
+ return train_test_split(x, y, test_size=0.2, random_state=23), preprocess
39
 
40
  # Train Model
41
+ def train_model(x_train, y_train, preprocess, model_name):
42
  models = {
43
  'Decision Tree': DecisionTreeClassifier(),
44
  'Logistic Regression': LogisticRegression(),