0
$\begingroup$

enter image description here

how can I apply decision tree classification to get malnutrition status(target variables are wasting, stunting,overweight,underweight)

$\endgroup$

1 Answer 1

0
$\begingroup$

Answer: You need to convert your target column into numbers first. You can try the following:

df['status'] = df['status'].map({'wasting': 0, 'stunting': 1, 'overweight': 2, 'underweight': 3})

After this you can run your Decision tree and you will get the df['status'] in number format. And then you can convert it back to strings using the following:

reverse_mapping = {0: 'wasting', 1: 'stunting', 2: 'overweight', 3: 'underweight'}
df['status'] = df['status'].map(reverse_mapping)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.