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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With