logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Write a Python code that creates two bar plots of average default rates (  Commercial_GBF_12m ) depending  on whether a company was under external administration External_Admin

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

 Foundations of Fintech - Assignment 5

This assignment builds on Lectures 10 to 12 and on Tutorials 8 to 11. You might want to consider using parts of the Python code discussed in those tutorials to answer some of the questions below.

Important: It is important that you do not change the type (markdown vs. code) of any cell, nor copy/paste/duplicate any cell! If the cell type is markdown, you are supposed to write text, not code, and vice versa. Provide your answer to each question in the allocated cell. Do not create additional cells. Answers provided in any other cell will not be marked. Do not rename the assignment files. All files in the assignment directory should be left as is.

 

Setting

Equifax Australia has provided us with synthetic loan application data from Australian proprietary companies. This data was generated to match the characteristics of actual lending proposals approved between February 2017 and March 2018. The Equifax data consists of two parts, which, to make it easier for you, we have merged together into one data set:

  1. Company Business Trading History Data: This first part of the data set contains historical business trading data from 25,000 Australian proprietary companies who were granted a loan between February 2017 and March

  2. Director Data: This second part of the data set contains information on up to four directors of each company. In case a company has more than one director, the corresponding data has been averaged across directors at the company

 

Since this is proprietary data that belongs to Equifax, we are not allowed to give you direct access to it. However, thanks to Jupyter Hub, you are able to access it remotely. In particular, using your knowledge from Tutorial 9, you are able to analyse it at an aggregate level and to use it for the estimation of credit scoring models.

The file called Equifax_Data_Dictionary.xlsx provides you with the dictionary for both company and director level data.

Helpful commands

The merged Equifax dataset will be referred to by the name assignment5 . Please see Tutorial 9 for the details of how to run functions on remote data. We have implemented additional functions to help you with this assignment. Details of these functions are below:

  1. send_grouped_mean_request() : This function takes inputs in the form of a dictionary containing names of two columns, and returns a Pandas dataframe that contains grouped means of a column with respect to another column. For example, using this function with input {"data": "tutorial9.1","var": "age", "y": "SeriousDlqin2yrs"} will return a dataframe where each entry has a value for age and the respective mean of SeriousDlqin2yrs for applicants' of that age (see Tutorial 10).

  2. send_glm_request() : This function takes inputs in the form of a reference to the remote data ("data") and the dependent variable ("y"), e., {"data": data, "y": y} , and outputs the detailed results of a full-fledged logistic regression model without feature selection.

  3. send_logit_request() : This function is similar to the send_nn_request() method, but it performs the remote estimation of a customised logistic It takes inputs in the form of a

dictionary {"data": data, "test": 0.2, "x": features, "y": y, "scale":"True"}

where:

 

  1. "data": Reference to the remote data (see below)

  2. "test": Fraction of the data used for testing

  3. "x": List of features (independent variables) used by the model

  4. "y": Target variable (dependent variable) of the model

  5. "scale": Indicator ("True"/"False") for scaling

Predefined variables

For your convenience, we have predefined certain variables which you should reuse for this assignment:

  1. data : The remote Equifax dataset that should be used in this assignment

  2. target : The target variable (default indicator over 12 months)

  3. all_features : The complete list of available features

 

Note: Please do not change the values of these variables.

 

In [ ]:

Question 1 (2 marks)

Write a Python code that creates two bar plots of average default rates (  Commercial_GBF_12m ) depending  on (i) whether a company was under external administration ( External_Admin ) or (ii) had filed petitions (https://www.thegazette.co.uk/all-notices/content/101087) ( Petitions ). Make sure your plots' axes are appropriately labelled.

 

Answer 1

 """Write your code in this cell"""

pass

Question 2 (2 marks)

Write a Python code that creates two plots of average default rates ( Commercial_GBF_12m ) as a function of

  • the number of months since a director's last commercial default ( ny7589_df_time_1 ) and (ii) the frequency of adverse commercial events over four years 48 months prior to application

( ny7601_adv_48_84m ). Make sure your plots' axes are appropriately labelled.

 

Answer 2

"""Write your code in this cell"""

pass

 

Question 3 (1 mark)

How do you interpret the above plots from Questions 1 and 2? What is your conclusion?

 

Answer 3

 YOUR ANSWER HERE

 

Question 4 (2 marks)

Run a full-fledged logistic regression model without any ex-ante feature selection. Based on the estimation output, select and report all features that are significant at the 5%-level (or below).

 

Note: To increase the stability of the estimation, Python will automatically omit certain variables.

 

Answer 4 - Code

"""Write your code in this cell"""

pass

Answer 4 - Text

YOUR ANSWER HERE

Question 5 (3 marks)

Run a logit model using the function send_logit_request() and applying the following specifications:

 

  1. Relative size of test data: 20%

  2. Only use the features from Question 4 with a significance level below 5%

  3. Scaling: "True"

Evaluate the testing performance of your logit model.

 

Answer 5 - Code

Answer 5 - Text

YOUR ANSWER HERE

 

Question 6 (4 marks)

Write a Python code that estimates a series of full-fledged neural networks with the following specifications:

  1. Number of layers: 1

  2. Number of units: 2, 4, 16, 64, 256

  3. Relative size of test data: 20%

  4. Scaling: "True"

Generate one plot that shows each model's ROC ("roc"), both for testing and training. What is your conclusion?

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

566 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

853 Answers

Hire Me
expert
Husnain SaeedComputer science

826 Answers

Hire Me
expert
Atharva PatilComputer science

839 Answers

Hire Me