Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Last answered:

07 Nov 2021

Posted on:

22 Jun 2021

0

data splitting from credit risk modeling

I don't understand this line of code
train_test_split(loan_data.drop('good_bad', axis = 1), loan_data['good_bad'])

why do we drop [good_bad] and then expect it in loan_data['good_bad']  as a result. I would like to have more clarification about. I failed to understand it for multiple time

1 answers ( 0 marked as helpful)
Posted on:

07 Nov 2021

0

Hi!
Our target var is 'good_bad', thus it has to be separeted from all other vars which are the inputs.
In the parentheses the first item (loan_data.drop('good_bad', axis = 1) refers to inputs and second one to the target var itself (loan_data['good_bad']).

Submit an answer