Optimization Grid with Random Forest - Not Working.

CarlN
CarlN New Altair Community Member
edited November 2024 in Community Q&A
RapidMiner Unicorns 🦄,

I trying to run a optimization grid with our my Random Forest model and I am getting an error.  It's stating that gain_ratio criterion cannot be used for numeric labels (see pictures below).  I checked all my parameters and I am not using gain_ratio in the optimization grid (see pictures below).  So, specifically how you used a optimization grid with cross validation, and random forest predicting a real number in RapidMiner? 

Can you send an basic working example of this workflow process with with good documented comments explaining each step.



Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Hi,
    can you show us your optimization settings? Likely you use least_square there.

    Also: Be careful using Explain Pred in the X-Val. This can take enormous amount of time.

    BR,
    Martin
  • CarlN
    CarlN New Altair Community Member
    Please see below.  Also, I am sending the results of the optimization to a log.  Let me know what this issue is or an example workflow process of how this works in RapidMiner.




  • MartinLiebig
    MartinLiebig
    Altair Employee
    Hi,
    you have a numeric label and try to vary the gain metric between [information_gain,gain_ratio,gini_index,accuracy]. This has to not work, since those are all metrics which don't work on numeric labels.

    Best,
    Martin
  • CarlN
    CarlN New Altair Community Member
    Okay, thanks for the explanation, but the solution is not clear from your response. 

    Specifically what configuration/setup tasks are needed to make the grid optimization operator work and simply find the optimal parameters for Random Forest model?  Do you have a sample workflow of how this can work?
  • CarlN
    CarlN New Altair Community Member
    Okay, thanks for the explanation, but the solution is not clear from your response. 

    Specifically what configuration/setup tasks are needed to make the grid optimization operator work and simply find the optimal parameters for Random Forest model?  Do you have a sample workflow of how this can work?
  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Hi!

    Just select correct and applicable settings for the optimization. Leave the criterion alone (it has to be least_square for numerical prediction) and optimize parameters like the number of trees and the maximum depth. 

    Regards,
    Balázs
  • CarlN
    CarlN New Altair Community Member
    I am using least_square in the Random Forest decision tree and it's still giving me an error (see below).  I still don't understand why it's not working.  Please educate me on the specific, step by step, how-to instructions to make this work.  Thank you much.


Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.