Cross Validation with Random Forest
dragon
New Altair Community Member
Hello there,
I cannot overcome a very simple problem that I have shown in the attached figure.
I want to do CrossValidation with RandomForest.
When I enter the inside of CV; I cannot get the output of the port (Wei), which gives the weight coefficients of the RF on the left, out of the CV.
When I do it with data split, I can connect directly to the res port and get it. But I can't get out of CV. I would appreciate it if you could help with this.
Tagged:
0
Best Answer
-
Hi @dragon,
you can use the Remember operator inside the validation and then Recall to get the saved value. By default it will give you the last result it stored. If you connect the Model output of the cross validation, it will build the model on the whole dataset and give you the weights for that.
If you're interested in step by step weights, you would do something like Store in each step with a macro that you increment after each execution (e. g. a macro named Nr, initialized with 1, and Store with something like "weights-%{Nr}").
Regards,
Balázs5
Answers
-
Hi @dragon,
you can use the Remember operator inside the validation and then Recall to get the saved value. By default it will give you the last result it stored. If you connect the Model output of the cross validation, it will build the model on the whole dataset and give you the weights for that.
If you're interested in step by step weights, you would do something like Store in each step with a macro that you increment after each execution (e. g. a macro named Nr, initialized with 1, and Store with something like "weights-%{Nr}").
Regards,
Balázs5 -
Thank you so much.0