-
-
Save AI-MOO/e5bbd24ffcf5b6d1f9ae950505a3e411 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# التعامل مع البيانات الفئوية وتحويلها إلى بيانات رقمية | |
Categorical_Features = ['sex', 'cp', 'fbs', 'restecg', 'exang', 'slope', 'ca', 'thal'] | |
new_dataset = pd.get_dummies(df_patients_data, columns = Categorical_Features) | |
# معايرة البيانات الرقمية | |
s_sc = StandardScaler() | |
col_to_scale = ['age', 'trestbps', 'chol', 'thalach', 'oldpeak'] | |
new_dataset[col_to_scale] = s_sc.fit_transform(new_dataset[col_to_scale]) | |
# تعويض الأعمدة المفقودة بالبيانات الجديدة واستبدال القيم المفقودة بـ 0 | |
patients_data = pd.merge(X_test, new_dataset, how='right').fillna(0, downcast='infer') | |
patients_data | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment