Spaces:
Sleeping
Sleeping
Update cancer.py
Browse files
cancer.py
CHANGED
|
@@ -33,10 +33,10 @@ def preprocess_data(df):
|
|
| 33 |
|
| 34 |
X = df.drop('Cancer_Present', axis=1)
|
| 35 |
y = df['Cancer_Present']
|
| 36 |
-
return train_test_split(
|
| 37 |
|
| 38 |
# Train Model
|
| 39 |
-
def train_model(
|
| 40 |
models = {
|
| 41 |
'Decision Tree': DecisionTreeClassifier(),
|
| 42 |
'Logistic Regression': LogisticRegression(),
|
|
|
|
| 33 |
|
| 34 |
X = df.drop('Cancer_Present', axis=1)
|
| 35 |
y = df['Cancer_Present']
|
| 36 |
+
return train_test_split(x, y, test_size=0.2, random_state=23), preprocess
|
| 37 |
|
| 38 |
# Train Model
|
| 39 |
+
def train_model(x_train, y_train, preprocess, model_name):
|
| 40 |
models = {
|
| 41 |
'Decision Tree': DecisionTreeClassifier(),
|
| 42 |
'Logistic Regression': LogisticRegression(),
|