Comments (5)
for 1) yup, change the nodesize to change the depth of each tree. a larger
nodesize will create smaller trees.
for 2) consider that a binary tree has 2^m possible nodes when the depth of the
tree is m. most data are not complicated enough that you will mostly never end
up with 2^m (an recursive xor dataset will get you a 2^m node tree, btw) so
many of the nodes are terminal and maynot even get to the 2^m depth. But the
way the tree is stored is by assuming that one is storing the probably 2^m
nodes (but fear not its incremented in a way that 2^m nodes are not really
stored but a much smaller fraction). The best way to get the tree structure is
to start at the root node, and get the child node and from that child node get
to the child of child node and so on. This information though is saved as a
contiguous vector and the zero means that the node is never created.
if you trying to understand how the tree structure is stored, maybe this will
help you http://code.google.com/p/randomforest-matlab/issues/detail?id=18&can=1
hope this helps
Original comment by abhirana
on 24 Oct 2012 at 2:15
from randomforest-matlab.
Hi, I am new to random forest and I do not understand that a larger nodesize
will create smaller trees. Wouldn't a larger nodesize will result in larger
depth (~log2(nodesize)) in trees, and therefore create bigger trees?
Thanks in advance.
Original comment by [email protected]
on 1 Aug 2014 at 9:31
from randomforest-matlab.
hello @hyojin
i think you are confusing number of nodes in a tree with nodesize.
nodesize = when a node has nodesize or less examples then the splitting stops.
let's say you are at the root node and let's say the k-th feature divides the
data at value v; examples that have value of k feature < v will fall in the
left node and examples with value k>=v will fall in the right node. this
splitting is recursively done till the number of nodes falling into a node are
less than or equal to nodesize. then the tree won't be further grown from that
node.
so a larger nodesize will create short trees and smaller nodesize will create
tall trees. note that this depth also depends on the type of tree;
classification trees will stop growing in a single level for linearly divisible
data.
Original comment by abhirana
on 3 Aug 2014 at 12:18
from randomforest-matlab.
Oh I see. Thanks. So nrnodes is the number of nodes, right? If I have trees
with nrnodes = 8001, then my tree would have maximum depth of log2(8001)?
Original comment by [email protected]
on 4 Aug 2014 at 2:45
from randomforest-matlab.
yup thats somewhat correct. note that unlike a purely binary tree, random
forest trees may be unbalanced and some branches may be longer than others,
some branches are terminated near the root node. so the right answer would be a
depth of O(log2(nrnodes))
Original comment by abhirana
on 9 Aug 2014 at 4:19
from randomforest-matlab.
Related Issues (20)
- weak learner HOT 1
- Compiling on Mac Lion HOT 6
- Compiled mexmaci64 for OSX 10.8.2 (Mountain Lion) HOT 2
- about the unbalanced data HOT 32
- Segmentation violation problem HOT 2
- Hierarchical sampling of data? HOT 3
- memory leak in HOT 1
- probability of classes for highly skewed dataset HOT 2
- Feature Normalization HOT 1
- sampsize problem
- score values from random forest HOT 1
- MATLAB crashes after tens of thousands runs !! HOT 3
- Compilation Problems with Matlab 2014a on Mac HOT 7
- How to get individual tree predictions for regression HOT 2
- use library (gcc) in matlab and error with compile of mex HOT 1
- NaN data HOT 4
- multivariate label output in regression analysis
- Matlab (randomly) crash after a number of runs HOT 5
- Directions for Bagging Regression HOT 2
- Quantifying Fractal Dimension HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from randomforest-matlab.