[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wekalist
Subject:    [Wekalist] Re: Random Forest model (number of trees)
From:       Neha gupta <neha.bologna90 () gmail ! com>
Date:       2021-04-27 23:32:58
Message-ID: CA+nrPnv_NLOvWDtOYFMcS6K_mRS28gN9eco=7_aZdbA-Fr_H+g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thank you Peter, very nice explanation.

In some literature, I read that the 'mtry' parameter of RF is sqrt(number
of features) for classification problems and number of features / 3 for
regression problems.

Kind regards

On Wed, Apr 28, 2021 at 12:32 AM Peter Reutemann <fracpete@waikato.ac.nz>
wrote:

> > I am sorry but I did not understand your point. In the more option, I
> can see
> >
> > numFeatures -- Sets the number of randomly chosen attributes. If 0,
> > int(log_2(#predictors) + 1)
> >
> > but how can I get the number of variables for each node? I have 20
> features in my dataset.
>
> #predictors is the number of attributes without the class. If you have
> 20 features incl the class, then you get:
> int(log_2(19)+1) = 5
>
> Broken down:
> log_2(19) ~ 4.25
> log_2(19) + 1 ~ 5.25
> int(log_2(19)+1) = 5
>
> That's the number of attributes that are randomly chosen for a tree in
> RandomForest.
>
> Cheers, Peter
> --
> Peter Reutemann
> Dept. of Computer Science
> University of Waikato, NZ
> +64 (7) 577-5304
> http://www.cms.waikato.ac.nz/~fracpete/
> http://www.data-mining.co.nz/
> _______________________________________________
> Wekalist mailing list -- wekalist@list.waikato.ac.nz
> Send posts to wekalist@list.waikato.ac.nz
> To unsubscribe send an email to wekalist-leave@list.waikato.ac.nz
> To subscribe, unsubscribe, etc., visit
> https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
> List etiquette:
> http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
>

[Attachment #5 (text/html)]

<div dir="ltr">Thank you Peter, very nice explanation.<div><br></div><div>In some \
literature, I read that the &#39;mtry&#39; parameter of RF is sqrt(number of \
features) for classification problems and number of features / 3 for regression \
problems.</div><div><br></div><div>Kind regards</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 28, 2021 at 12:32 \
AM Peter Reutemann &lt;<a \
href="mailto:fracpete@waikato.ac.nz">fracpete@waikato.ac.nz</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; I am sorry but I \
did not understand your point. In the more option, I can see<br> &gt;<br>
&gt; numFeatures -- Sets the number of randomly chosen attributes. If 0,<br>
&gt; int(log_2(#predictors) + 1)<br>
&gt;<br>
&gt; but how can I get the number of variables for each node? I have 20 features in \
my dataset.<br> <br>
#predictors is the number of attributes without the class. If you have<br>
20 features incl the class, then you get:<br>
int(log_2(19)+1) = 5<br>
<br>
Broken down:<br>
log_2(19) ~ 4.25<br>
log_2(19) + 1 ~ 5.25<br>
int(log_2(19)+1) = 5<br>
<br>
That&#39;s the number of attributes that are randomly chosen for a tree in<br>
RandomForest.<br>
<br>
Cheers, Peter<br>
-- <br>
Peter Reutemann<br>
Dept. of Computer Science<br>
University of Waikato, NZ<br>
+64 (7) 577-5304<br>
<a href="http://www.cms.waikato.ac.nz/~fracpete/" rel="noreferrer" \
target="_blank">http://www.cms.waikato.ac.nz/~fracpete/</a><br> <a \
href="http://www.data-mining.co.nz/" rel="noreferrer" \
target="_blank">http://www.data-mining.co.nz/</a><br> \
_______________________________________________<br> Wekalist mailing list -- <a \
href="mailto:wekalist@list.waikato.ac.nz" \
target="_blank">wekalist@list.waikato.ac.nz</a><br> Send posts to <a \
href="mailto:wekalist@list.waikato.ac.nz" \
target="_blank">wekalist@list.waikato.ac.nz</a><br> To unsubscribe send an email to \
<a href="mailto:wekalist-leave@list.waikato.ac.nz" \
target="_blank">wekalist-leave@list.waikato.ac.nz</a><br> To subscribe, unsubscribe, \
etc., visit <a href="https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz" \
rel="noreferrer" target="_blank">https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz</a><br>
 List etiquette: <a href="http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html" \
rel="noreferrer" target="_blank">http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html</a><br>
 </blockquote></div>



_______________________________________________
Wekalist mailing list -- wekalist@list.waikato.ac.nz
Send posts to wekalist@list.waikato.ac.nz
To unsubscribe send an email to wekalist-leave@list.waikato.ac.nz
To subscribe, unsubscribe, etc., visit \
https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz List \
etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic