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