Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -2,8 +2,14 @@ import gradio as gr
|
|
2 |
import pycaret
|
3 |
from pycaret.classification import *
|
4 |
import pandas as pd
|
|
|
5 |
healthcare_stroke_data = pd.read_csv("healthcare-dataset-stroke-data.csv")
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
modelvalue= setup(data = healthcare_stroke_data, target = 'stroke', normalize = True, normalize_method = 'zscore', transformation=True, fix_imbalance = True, session_id=123, fold = 60, remove_outliers= True, outliers_threshold = 0.05, remove_multicollinearity=True, multicollinearity_threshold = 0.9)
|
8 |
|
9 |
best = compare_models(sort = 'AUC', n_select = 15)
|
|
|
2 |
import pycaret
|
3 |
from pycaret.classification import *
|
4 |
import pandas as pd
|
5 |
+
import category_encoders as ce
|
6 |
healthcare_stroke_data = pd.read_csv("healthcare-dataset-stroke-data.csv")
|
7 |
|
8 |
+
encoder= ce.OrdinalEncoder(cols=['gender'],return_df=True, mapping=[{'col':'gender', 'mapping':{0: 1, 1: 2,'Other': 3}}])
|
9 |
+
healthcare_stroke_data['gender'] = encoder.fit_transform(healthcare_stroke_data['gender'])
|
10 |
+
encoder= ce.OrdinalEncoder(cols=['work_type'],return_df=True, mapping=[{'col':'work_type', 'mapping':{0: 1, 1: 2, 'children': 3, '2': 4, 'Never_worked': 5}}])
|
11 |
+
healthcare_stroke_data['work_type'] = encoder.fit_transform(healthcare_stroke_data['work_type'])
|
12 |
+
|
13 |
modelvalue= setup(data = healthcare_stroke_data, target = 'stroke', normalize = True, normalize_method = 'zscore', transformation=True, fix_imbalance = True, session_id=123, fold = 60, remove_outliers= True, outliers_threshold = 0.05, remove_multicollinearity=True, multicollinearity_threshold = 0.9)
|
14 |
|
15 |
best = compare_models(sort = 'AUC', n_select = 15)
|