Created
May 16, 2022 12:08
-
-
Save audhiaprilliant/3dea3cdc1266d210fe51a448882cc0fa to your computer and use it in GitHub Desktop.
End to end machine learning model deployment using flask
This file contains hidden or 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
| # One hot encoder | |
| # Add new column of Loan_Status with 999 in testing data | |
| df_test['Loan_Status'] = 999 | |
| # Concat the training and testing data | |
| df_concat = pd.concat(objs = [df_train , df_test], axis = 0) | |
| # Drop the column of Loan_ID | |
| df_concat.drop(columns = ['Loan_ID'], inplace = True) | |
| # Categorical columns | |
| cols_obj_train = ['Gender', 'Married', 'Dependents', 'Education', 'Self_Employed', 'Credit_History', 'Property_Area'] | |
| # One-hot encoding | |
| df_concat = pd.get_dummies(data = df_concat, columns = cols_obj_train, drop_first = True) | |
| print('Dimension data: {} rows and {} columns'.format(len(df_concat), len(df_concat.columns))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment