Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Random Forests with a Customized Loss Function

I am a complete beginner in the field of machine learning. For a project, I have to use a customized loss function in the Random Forest Classification. I have used scikit till now. Suggestions on implementing this through scikit will be more helpful.

like image 455
here_to_learn Avatar asked May 01 '26 22:05

here_to_learn


1 Answers

Loss functions (Gini impurity and entropy in case of classification trees) are implemented in _tree.pyx cython file in scikit (they're called criteria in the source). You can start by modifying/adding to these functions. If you add your custom loss function (criterion) to the cython file, you also need to expose it in the tree.py python file (look at the CRITERIA_CLF and CRITERIA_REG lists).

like image 111
Ando Saabas Avatar answered May 05 '26 02:05

Ando Saabas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!