1

In sklearn's documentation https://scikit-learn.org/1.4/modules/generated/sklearn.ensemble.RandomForestRegressor.html it states that the default scoring for OOB samples are r2. It also states that you can provide your own metric by "providing a callable with signature metric(y_true, y_pred) to use a custom metric."

However, I am not entirely sure how I would implement this. I would like to use MSE instead of r2. Can anybody help? There does not seem to be any previous examples I can find where they have managed to implement their own scoring.

Further: Why is that sklearn always using r2 as the scoring metric? I have never heard of using this before. I always thought that the go-to was MSE or RMSE, so why does sklearn always use r2 scoring?

Thanks.

0 Answers0