Question: I need python help. I do not not where to start and keep getting errors in my code. The dataset (CreditData.csv) classifies customers as approved

I need python help. I do not not where to start and keep getting errors in my code. The dataset (CreditData.csv) classifies customers as "approved" or "not approved" (Yes or No) (i.e., target class).
The target class is in the 21st column and its name is "Approved".
Number of Attributes for Classification: 20 (7 numerical, 13 categorical).
The task must be developed using Python.
Tasks:
1 - Divide data into two datasets
• 80% as training data
• 20% as test data
 

2 - Build a classification model based on the training data to predict if a new customer is approved or not.
• You can use Regression or Decision Tree.


3 - Test the model on the test data and build the confusion matrix.


4 - Perform the following tasks:
• Using the confusion matrix, calculate the accuracy, precision, and recall 

 

Here is the attribute description for the dataset:
 

Attribute 1: (qualitative)
Status of existing checking account
•A11: balance = $0
•A12: balance ≤ $200K
•A13: balance > $200K
•A14: no checking account


Attribute 2: (numerical)
Duration of bank membership in month


Attribute 3: (qualitative)
Credit history
•A30: no credits taken/all credits paid back duly
•A31: all credits at this bank paid back duly
•A32: existing credits paid back duly till now
•A33: delay in paying off in the past
•A34: critical account/other credits existing (not at this bank)
 

Attribute 4: (qualitative)
Purpose of applying for a loan
•A40: car (new)
•A41: car (used)
•A42: furniture/equipment
•A43: radio/television
•A44: domestic appliances
•A45: repairs
•A46: education
•A47: vacation
•A48: retraining
•A49: business
•A410: others


Attribute 5: (numerical)
Credit amount

 


Attribute 6: (qualitative)
Savings account/bonds
•A61: value < $10K
•A62: $10K ≤ value < $50K
•A63: $50K ≤ value < $100K
•A64: value ≥ $100K
•A65: unknown/ no savings account


Attribute 7: (qualitative)
Present employment since
•A71: unemployed
•A72: employment period < 1 year
•A73: 1 ≤ employment period < 4 years
•A74: 4 ≤ employment period < 7 years
•A75: employment period ≥ 7 years
Attribute 8: (numerical)
Installment rate in percentage of disposable income


Attribute 9: (qualitative)
Personal status and sex
•A91: male and married/divorced/separated
•A92: female and married/divorced/separated
•A93: male and single
•A94: female and single


Attribute 10: (qualitative)
Other debtors / guarantors
•A101: none
•A102: co-applicant
•A103: guarantor


Attribute 11: (numerical)
Present residence since how many year ago


Attribute 12: (qualitative)
Property
•A121: real estate
•A122: if not A121: building society savings agreement/life insurance
•A123: if not A121/A122: car or other, not in attribute 6
•A124: unknown/no property


Attribute 13: (numerical)
Age in years


Attribute 14: (qualitative)
Other installment plans
•A141: bank
•A142: stores
•A143: none


Attribute 15: (qualitative)
Housing
•A151: rent
•A152: own
•A153: for free


Attribute 16: (numerical)
Number of existing credits at this bank


Attribute 17: (qualitative)
Job
•A171: unemployed/unskilled - non-resident
•A172: unskilled - resident
•A173: skilled employee/official
•A174: management/self-employed/highly qualified employee/officer


Attribute 18: (numerical)
Number of people being liable to provide maintenance for


Attribute 19: (qualitative)
Telephone
•A191: none
•A192: yes, registered under the customer's name


Attribute 20: (qualitative)
Foreign worker
•A201: yes
•A202: no

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!