About Play Tennis Decision Tree
This page builds the play-tennis decision tree, the standard teaching example from J. R. Quinlan's ID3 paper: 14 days of weather and whether tennis was played. It is free, needs no sign-up and runs in your browser, so nothing you enter is uploaded.
Nine days were yes and five were no, so the root node has an entropy of 0.940 bits. Splitting on outlook gives an information gain of 0.247, humidity 0.152, wind 0.048 and temperature 0.029, so outlook wins the root. Overcast days are all yes, sunny days then split on humidity and rainy days on wind.
The tree is grown with entropy and no test split, since 14 rows are too few to hold any back. Switch to Gini to see that it picks the same root.
How to use Play Tennis Decision Tree
- Pick a sample dataset, or paste your own CSV with a header row.
- Choose the target column, the one you want to predict. It should have a handful of classes.
- Choose Gini impurity or entropy, and set the maximum depth and the minimum number of rows needed to split a node.
- Set a test share, for example 20%, to hold some rows back and measure accuracy on unseen data.
- Read the accuracy figures, then look at the tree. Tap a box to fold its branch, or scroll sideways on a small screen.
- Check the feature importance chart, and open the rules to copy the tree as text.
Features
- Numeric columns split on a threshold; text columns get one branch per value.
- Gini impurity or entropy as the split quality measure.
- Maximum depth, minimum rows to split and a repeatable train and test split.
- A tree diagram in responsive SVG with foldable branches, scrollable on phones.
- Feature importance as the share of total impurity reduction.
- Root impurity and information gain, so you can check a textbook calculation.
- The tree as if-then rules, which you can copy.
- Iris, a Titanic subset and play-tennis built in, with their sources stated.
Worked examples
14 days, entropy, depth 4 gives root: outlook, gain 0.247
The finished tree has 8 nodes and 5 leaves and classifies all 14 days correctly (100%).
Privacy: how it works
- Your CSV is parsed and the tree is grown in your browser tab. Nothing is sent to Ulkaa or anyone else.
Tips
- Remove ID columns, names and anything that would not be known when you need to predict.
- Compare Gini and entropy on your data. They usually pick the same splits and differ only in the details.
- Fold the branches of a big tree and read the top levels first. Those hold the strongest signals.
- The test split is random but repeatable, so the same settings always give the same numbers.
Frequently asked questions
Is it really free?
Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.
Do I need an account?
No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.
Does it run in my browser?
Yes. Your CSV data are processed by code running in your browser tab, on your own device.
Is my data uploaded?
No. Your CSV data are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.
Where does the play-tennis data come from?
It is the 14-row example in J. R. Quinlan's 1986 paper on the ID3 algorithm, used in most machine learning textbooks.
Why is outlook the root?
It has the highest information gain, 0.247 bits, because overcast days are all yes and the other two outlooks are far less mixed than the whole table.
More Decision Tree Builder pages
- Decision Tree BuilderPaste a CSV, choose the column to predict and watch a decision tree grow, split by split.
- Titanic Survival Decision TreePredict who survived from class, sex and age with a small, readable tree.
- Gini Impurity CalculatorSee the Gini impurity of a node and of its children after the best split.
- Information Gain CalculatorCompute the entropy of a node and the information gain of the best split.
- Decision Tree Feature ImportanceRank the columns of your data by how much a tree depends on them.
- Decision Tree OverfittingGrow an unrestricted tree and compare its training and test accuracy.
- Entropy vs Gini in a Decision TreeSwitch between the two split criteria and compare the trees they build.