Skip to content
ToolUlkaa Tool
All tools

Machine Learning

TensorFlow PlaygroundConfusion Matrix CalculatorROC Curve and AUC CalculatorK-Means Clustering VisualizerGradient Descent VisualizerDecision Tree BuilderClassifier PlaygroundPCA VisualizerActivation Function Plotter

Categories

AcademicTextMathematicsStatisticsMachine LearningAIData ScienceFile
All tools
Machine Learning

Decision Tree Overfitting

Grow an unrestricted tree and compare its training and test accuracy.

Try:
Commas, tabs or semicolons. Numeric columns split on a threshold; text columns get one branch per value. Rows with empty cells are skipped.
Split quality
1 to 12
2 or more
0 to 50

Source: Fisher's Iris data (R. A. Fisher, 1936), 150 flowers, from the UCI Machine Learning Repository. Public domain facts.

Test accuracy

91.7%

The tree was grown on 90 rows and checked on 60 rows it never saw (a fixed, repeatable split). A big gap between training accuracy (100%) and test accuracy is the sign of overfitting.

Training accuracy
100%
90 rows
Test accuracy
91.7%
60 rows
Depth
6
13 nodes, 7 leaves
Root impurity
0.6657
gini
Root impurity decrease
0.3216
Classes
3
setosa, versicolor, virginica

Tree

<= 2.6> 2.6<= 1.65> 1.65<= 5.05<= 2.9> 2.9<= 6> 6<= 6.4> 6.4> 5.05petal_length <= 2.6gini = 0.666, n = 90[28, 32, 30]versicolorleafgini = 0, n = 28[28, 0, 0]setosapetal_width <= 1.65gini = 0.499, n = 62[0, 32, 30]versicolorleafgini = 0, n = 30[0, 30, 0]versicolorpetal_length <= 5.05gini = 0.117, n = 32[0, 2, 30]virginicasepal_width <= 2.9gini = 0.408, n = 7[0, 2, 5]virginicaleafgini = 0, n = 4[0, 0, 4]virginicasepal_length <= 6gini = 0.444, n = 3[0, 2, 1]versicolorleafgini = 0, n = 1[0, 1, 0]versicolorsepal_length <= 6.4gini = 0.5, n = 2[0, 1, 1]versicolorleafgini = 0, n = 1[0, 0, 1]virginicaleafgini = 0, n = 1[0, 1, 0]versicolorleafgini = 0, n = 25[0, 0, 25]virginica

Each box shows the split, the gini value, the number of rows, the count of rows per class ([setosa, versicolor, virginica]) and the majority class. Tap a box to fold its branch. Scroll sideways on a small screen.

Feature importance

  • petal_length49.8%
  • petal_width45.4%
  • sepal_width2.5%
  • sepal_length2.2%

Importance is the share of the total impurity reduction that each feature's splits produced, weighted by the rows they covered.

The tree as rules

Show 19 lines of if-then rules
if petal_length <= 2.6:
  predict setosa (28 rows)
if petal_length > 2.6:
  if petal_width <= 1.65:
    predict versicolor (30 rows)
  if petal_width > 1.65:
    if petal_length <= 5.05:
      if sepal_width <= 2.9:
        predict virginica (4 rows)
      if sepal_width > 2.9:
        if sepal_length <= 6:
          predict versicolor (1 rows)
        if sepal_length > 6:
          if sepal_length <= 6.4:
            predict virginica (1 rows)
          if sepal_length > 6.4:
            predict versicolor (1 rows)
    if petal_length > 5.05:
      predict virginica (25 rows)
  1. Tools
  2. Machine Learning
  3. Decision Tree Builder
  4. Decision Tree Overfitting

About Decision Tree Overfitting

This page grows an iris tree to depth 10 with 40% of the rows held out, so you can compare accuracy on the rows it learned with accuracy on rows it never saw. It is free, needs no sign-up and runs in your browser, so nothing you enter is uploaded.

With a deep limit the tree keeps splitting until every leaf is pure, which fits noise as well as signal. Training accuracy goes to 100%. Test accuracy does not follow, because the extra splits describe quirks of the training rows. Lower the maximum depth to 2 and the training accuracy falls slightly while the test accuracy holds or rises, a sign of a model that generalises better.

The iris data is easy and small, so the effect here is mild; on noisy real data the gap is usually much larger. A 40% test share means the test figure is itself noisy with 150 rows, so try different depths and compare, not a single number.

How to use Decision Tree Overfitting

  1. 1Pick a sample dataset, or paste your own CSV with a header row.
  2. 2Choose the target column, the one you want to predict. It should have a handful of classes.
  3. 3Choose Gini impurity or entropy, and set the maximum depth and the minimum number of rows needed to split a node.
  4. 4Set a test share, for example 20%, to hold some rows back and measure accuracy on unseen data.
  5. 5Read the accuracy figures, then look at the tree. Tap a box to fold its branch, or scroll sideways on a small screen.
  6. 6Check 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

  • Iris, Gini, depth 10, 40% test → gives train 100%, test 91.7%

    At depth 2 the same split gives train 97.8% and test 93.3%.

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.

What is overfitting in a decision tree?

The tree fits the training rows so closely, noise included, that it does worse on new rows than a simpler tree would.

How do I prevent it?

Limit depth, require a minimum number of rows to split, prune the tree, or average many trees in a random forest.

More Decision Tree Builder pages

  • Decision Tree BuilderPaste a CSV, choose the column to predict and watch a decision tree grow, split by split.
  • Play Tennis Decision TreeThe textbook 14-day table, turned into a tree with entropy and information gain.
  • 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.
  • Entropy vs Gini in a Decision TreeSwitch between the two split criteria and compare the trees they build.

Ulkaa Apps

  • Ulkaa
  • Calendar
  • Task
  • Note
  • Disk
  • Call
  • Contact
  • Mail
  • Finance
  • Health
  • Office
  • Work
  • Workspace
  • Halum
  • Jaal
  • Islam
  • Game
  • Weather
  • Campus
  • News
  • Developer
  • Help
  • Account
About·Privacy·Terms·© 2026 Ulkaa

What is Ulkaa Tool?

Ulkaa Tool is a free collection of fast, privacy-friendly online tools from Ulkaa Network. Calculate your GPA and CGPA, edit rich text, count words and characters, replace text and more — all in your browser.

Every tool runs entirely in your browser — no sign-up, and your data never leaves your device.

Academic

  • GPA Calculator
  • CGPA Calculator
  • Citation Generator
  • Quiz Maker

Text

  • Rich Text Editor
  • Word Counter
  • Character Counter
  • Text Replacement

Ulkaa

  • Ulkaa
  • Ulkaa News
  • Ulkaa Campus
  • Ulkaa Tool
  • Ulkaa Game
  • Ulkaa Weather
  • Ulkaa Islam

Company

  • About Ulkaa
  • Careers
  • Support
  • Help
  • Privacy Policy
  • Terms of Service
  • Disclaimer
  • Sitemap

© 2015-26, Ulkaa. All rights reserved.
Facebook PageLinkedIn CompanyX (Twitter) ProfileInstagram ProfileGitHub Account