Created
May 16, 2022 12:04
-
-
Save audhiaprilliant/7a2b8b35658f1f4f72aee75f9541dfe8 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
| # Number of customers by loan status and educations | |
| # Data aggregation between loan status and dependents | |
| df_viz_3 = df_train.groupby(['Loan_Status', 'Education'])['Loan_ID'].count().reset_index(name = 'Total') | |
| # Map the loan status | |
| df_viz_3['Loan_Status'] = df_viz_3['Loan_Status'].map( | |
| { | |
| 0: 'Not default', | |
| 1: 'Default' | |
| } | |
| ) | |
| # Data viz | |
| plotnine.options.figure_size = (8, 4.8) | |
| ( | |
| ggplot( | |
| data = df_viz_3 | |
| )+ | |
| geom_bar( | |
| aes( | |
| x = 'Education', | |
| y = 'Total', | |
| fill = 'Loan_Status' | |
| ), | |
| stat = 'identity', | |
| position = 'fill', | |
| width = 0.5 | |
| )+ | |
| labs( | |
| title = 'Number of customers by loan status and educations', | |
| fill = 'Loan status' | |
| )+ | |
| xlab( | |
| 'Educations' | |
| )+ | |
| ylab( | |
| 'Frequency' | |
| )+ | |
| scale_x_discrete( | |
| limits = ['Graduate', 'Not Graduate'] | |
| )+ | |
| scale_fill_manual( | |
| values = ['#981220','#80797c'], | |
| labels = ['Default', 'Not Default'] | |
| )+ | |
| theme_minimal() | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment