Created
May 16, 2022 12:06
-
-
Save audhiaprilliant/cb7890078629b9e5b27693e47ff2c4f4 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
| # The distribution of loan amount by loan status | |
| # Slice the columns | |
| df_viz_5 = df_train[['LoanAmount', 'Loan_Status']].reset_index(drop = True) | |
| # Map the loan status | |
| df_viz_5['Loan_Status'] = df_viz_5['Loan_Status'].map( | |
| { | |
| 0: 'Not default', | |
| 1: 'Default' | |
| } | |
| ) | |
| # Data viz | |
| plotnine.options.figure_size = (8, 4.8) | |
| ( | |
| ggplot( | |
| data = df_viz_5 | |
| )+ | |
| geom_density( | |
| aes( | |
| x = 'LoanAmount', | |
| fill = 'Loan_Status' | |
| ), | |
| color = 'white', | |
| alpha = 0.85 | |
| )+ | |
| labs( | |
| title = 'The distribution of loan amount by loan status' | |
| )+ | |
| scale_fill_manual( | |
| name = 'Loan Status', | |
| values = ['#981220','#80797c'], | |
| labels = ['Default', 'Not Default'] | |
| )+ | |
| xlab( | |
| 'Loan amount' | |
| )+ | |
| ylab( | |
| 'Density' | |
| )+ | |
| theme_minimal() | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment