Decision Tree Classifier

posted Originally published at dev.to 1 min read

My poor dad suffers from ckd, maybe performing data analysis on ckd data will allow me to give him some comfort behind the reason for his poor appetite. University of California, Irvine (UCI) has some data on ckd patients, this data contains biomarkers related to ckd along with appetite information. A decision tree is helpful in making sense of such a huge amount of data, it helps reason about the data in a more human-like way, answering yes or no questions at every step, whenever it encounters relevant biomarkers. For example, if hemoglobin is <= 10.25 the patient is likely to report poor appetite.

You can train your model with existing data so that when you pass similar information in the future and it can predict the outcome. sklearn provides a method that does this automatically (no fun), it’s called DecisionTreeClassifier.

You train it with the existing data and then it’s ready to receive data (without the outcome) and give you the outcome. However, different from other methods, this one gives you a decision tree, binary, yes or no splits at every level.

All the dark blue squares are the outcomes where the patient is likely to report poor appetite. Download the full decision tree here: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ben9ui1wxrg6m45rokmn.png

1 Comment

0 votes

More Posts

TypeScript Complexity Has Finally Reached the Point of Total Absurdity

Karol Modelskiverified - Apr 23

Your Tech Stack Isn’t Your Ceiling. Your Story Is

Karol Modelskiverified - Apr 9

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Everyone says DeepSeek is cheaper, but I got tired of guessing the exact math. So I built a calculat

abarth23 - Apr 27

Tuesday Coding Tip 02 - Template with type-specific API

Jakub Neruda - Mar 10
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!