regression tree/classification tree, tree depth, dont understand synatx

3 ビュー (過去 30 日間)
Tania
Tania 2014 年 7 月 1 日
コメント済み: Alan Weiss 2014 年 8 月 1 日
Can someone explain me the following syntax (especially the one in bold), which is used in order to determine the optimal tree depth of a regression tree/classification tree: Generate minimum leaf occupancies for classification trees from 10 to 100, spaced exponentially apart:
leafs = logspace(1,2,10);
Create cross validated classification trees for the ionosphere data with minimum leaf occupancies from leafs:
rng('default') N = numel(leafs); err = zeros(N,1); for n=1:N t = ClassificationTree.fit(X,Y,'crossval','on',... 'minleaf',leafs(n)); err(n) = kfoldLoss(t); end plot(leafs,err); xlabel('Min Leaf Size'); ylabel('cross-validated error');
You can also find it under http://www.mathworks.de/de/help/stats/classification-trees-and-regression-trees.html#bsw6p3v . Also does anyone know how the default tree depth is generated? Any help on this question is very welcome, thank you!:)

採用された回答

Alan Weiss
Alan Weiss 2014 年 7 月 1 日
doc logspace
y = logspace(a,b,n) generates n points between decades 10^a and 10^b.
doc rng
rng('default') puts the settings of the random number generator used by rand, randi, and randn to their default values so that they produce the same random numbers as if you restarted MATLAB. The default settings are the Mersenne Twister with seed 0.
doc kfoldLoss
Well, you get the idea. If, after reading the documentation, you still have some questions, feel free to ask again.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 件のコメント
Tania
Tania 2014 年 8 月 1 日
Thanks. Do you know what the difference is between "control depth" and "pruning" in the link I posted before: http://www.mathworks.de/de/help/stats/classification-trees-and-regression-trees.html#bsw6p3v .
It basically does the same or?
Thanks!
Alan Weiss
Alan Weiss 2014 年 8 月 1 日
I cannot add anything to the documentation, sorry--the documented description of pruning and methods of setting the leafiness are about the depth of my knowledge.
Alan Weiss
MATLAB mathematical toolbox documentation

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by