資源簡介
各種決策樹分類的代碼,包括ID3、c4.5等等,有界面可以運行
代碼片段和文件信息
classdef?classregtree
%CLASSREGTREE?Create?a?classification?and?regression?tree?object.
%???T?=?CLASSREGTREE(XY)?creates?a?decision?tree?T?for?predicting?response
%???Y?as?a?function?of?predictors?X.??X?is?an?N-by-M?matrix?of?predictor
%???values.?If?Y?is?a?vector?of?N?response?values?then?CLASSREGTREE
%???performs?regression.??If?Y?is?a?categorical?variable?character?array
%???or?cell?array?of?strings?CLASSREGTREE?performs?classification.??Either
%???way?T?is?a?binary?tree?where?each?non-terminal?node?is?split?based?on
%???the?values?of?a?column?of?X.??NaN?values?in?X?are?taken?to?be?missing
%???values.?NaN?values?empty?strings?or?undefined?categorical?levels?in?Y
%???are?taken?to?be?missing.?Observations?with?all?missing?values?for?X?or
%???missing?values?for?Y?are?not?used?in?the?fit.?Observations?with?some
%???missing?values?for?X?are?used?to?find?splits?on?variables?for?which
%???these?observations?have?valid?values.
%
%???T?=?CLASSREGTREE(XY‘PARAM1‘val1‘PARAM2‘val2...)?specifies?optional
%???parameter?name/value?pairs:
%
%???For?all?trees:
%??????‘categorical‘?Vector?of?indices?of?the?columns?of?X?that?are?to?be
%???????????????????treated?as?unordered?categorical?variables.
%??????‘method‘?????Either?‘regression‘?(default?if?Y?is?numeric)?or
%???????????????????‘classification‘?(default?if?Y?is?not?numeric).
%??????‘names‘??????A?cell?array?of?names?for?the?predictor?variables
%???????????????????in?the?order?in?which?they?appear?in?the?X?matrix
%???????????????????from?which?the?tree?was?created.
%??????‘prune‘??????‘on‘?(default)?to?compute?the?full?tree?and?the?optimal
%???????????????????sequence?of?pruned?subtrees?or?‘off‘?for?the?full?tree
%???????????????????without?pruning.
%??????‘minparent‘??A?number?K?such?that?impure?nodes?must?have?K?or?more
%???????????????????observations?to?be?split?(default?10).
%??????‘minleaf‘????A?minimal?number?of?observations?per?tree?leaf
%???????????????????(default=1).?If?both?‘minparent‘?and?‘minleaf‘?are
%???????????????????supplied?the?setting?which?results?in?larger?leaves?is
%???????????????????used:?MINPARENT?=?MAX(MINPARENT2*MINLEAF).
%??????‘nvartosample‘?Number?of?predictor?variables?randomly?selected
%?????????????????????for?each?split.?By?default?all?variables?are
%?????????????????????considered?for?each?decision?split.
%??????‘mergeleaves‘?‘on‘?(default)?to?merge?leaves?that?originate?from?the
%????????????????????same?parent?node?and?give?the?sum?of?risk?values
%????????????????????greater?or?equal?to?the?risk?associated?with?the
%????????????????????parent?node.?If?‘off‘?leaves?are?not?merged.
%??????‘weights‘?????Vector?of?observation?weights.?By?default?the?weight
%????????????????????of?every?observation?is?set?to?1.?The?length?of?this
%????????????????????vector?must?be?equal?to?the?number?of?rows?in?X.
%??????‘surrogate‘???‘on‘?to?find?surrogate?splits?at?each?branch?node.
%????????????????????Default?is?‘off‘.?If?you?set?this?parameter?to?‘on‘
%?????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????47772??2014-09-28?16:44??決策樹代碼\classregtree.m
?????文件????????3601??2014-09-28?16:59??決策樹代碼\ID3.m
評論
共有 條評論