Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with decision trees

I know tl;dr;

I'll try to explain my problem without bothering you with ton's of crappy code. I'm working on a school assignment. We have pictures of smurfs and we have to find them with foreground background analysis. I have a Decision Tree in java that has all the data (HSV histograms) 1 one single node. Then tries to find the best attribute (from the histogram data) to split the tree on. Then executes the split and creates a left and a right sub tree with the data split over both node-trees. All the data is still kept in the main tree to be able to calculate the gini index.

So after 26 minutes of analysing smurfs my pc has a giant tree with splits and other data. Now my question is, can anyone give me a global idea of how to analyse a new picture and determine which pixels could be "smurf pixels". I know i have to generate a new array of data points with the HSV histograms of the new smurf and then i need to use the generated tree to determine which pixels belong to a smurf.

Can anyone give me a pointer on how to do this?

Some additional information.
Every Decision Tree object has a Split object that has the best attribute to split on, the value to split on and a gini index.

If i need to provide any additional information I'd like to hear it.

like image 858
TFennis Avatar asked Feb 13 '11 11:02

TFennis


People also ask

How does a decision tree work step by step?

The decision tree splits the nodes on all available variables and then selects the split which results in most homogeneous sub-nodes. The ID3 algorithm builds decision trees using a top-down greedy search approach through the space of possible branches with no backtracking.

What is decision tree explain its working?

A decision tree is a non-parametric supervised learning algorithm, which is utilized for both classification and regression tasks. It has a hierarchical, tree structure, which consists of a root node, branches, internal nodes and leaf nodes.

How does decision tree works in machine learning?

Introduction Decision Trees are a type of Supervised Machine Learning (that is you explain what the input is and what the corresponding output is in the training data) where the data is continuously split according to a certain parameter. The tree can be explained by two entities, namely decision nodes and leaves.


1 Answers

OK. Basically, in unoptimized pseudo-code: In order to label pixels in a new image:

For each pixel in the new image:

  • Calculate pixel's HSV features
  • Recursively, starting from the tree's root :
  • Is this a leaf? if it is, give the pixel the dominant label of the node.
  • Otherwise, check the splitting criterion against the pixel's features, and go to the right or left child accordingly

I hope this makes sense in your context.

like image 176
Yuval F Avatar answered Oct 21 '22 01:10

Yuval F