0

I would like to set up a random forest for my fitness function using a genetic algorithm, like they do with weights in neural networks... But it's quite difficult for me to figure out what exactly I need to change in the rf model

set.seed(123)
X <- matrix(rnorm(1000),ncol = 5)
Y <- rnorm(nrow(X))
library(randomForest)
rf <- randomForest(Y~.,X,ntree=50)

I guess I need to change something in rf$forest$... but what exactly I am not very clear about. Can someone explain to me what exactly I need to change in order to change the model and adjust it for my fitness function

mr.T
  • 181
  • 2
  • 13
  • Genetic algorithms are used for optimization and random forests for regression and classification. A fitness function should be fully defined from the data, so I'm not sure how you see random forest playing a role. – Arthur Mar 08 '22 at 14:02
  • neural network weights can be optimized by a genetic algorithm, neural networks are used for classification and regression. I don't understand where you see the problem? – mr.T Mar 08 '22 at 14:11

0 Answers0