dmlc / XGBoost.jl

XGBoost Julia Package
Other
289 stars 110 forks source link

Has anyone used XGBoost in Julia with Customised Objective Function? #74

Closed compleathorseplayer closed 4 years ago

compleathorseplayer commented 5 years ago

There are a couple of examples in the XGBoost forums using customised objective functions in R, but I have not seen any in Julia/XGB. Any hints would be appreciated. Also, if I get something working, I will post it.

Since I first put this up, I noticed the example given on here, which is much appreciated. Unfortunately, it does not quite run as written, but does run with a few minor changes. These are (1 putting the names of the objective function and evalerror in quotes in the calling sequence, and (2, more subtle) changing exp(-preds) to exp.(-preds) as Julia is picky about functions acting elementwise on arrays or vectors (fair enough in this case, as exp() of a square matrix has another meaning).

aviks commented 4 years ago

This example may help: https://juliacomputing.com/blog/2020/02/24/ad-xgboost.html