[doc] Update custom_metric_obj.rst (#8626)

This commit is contained in:
Emre Batuhan Baloğlu 2023-01-06 00:08:25 +03:00 committed by GitHub
parent e68a152d9e
commit 2b88099c74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,6 +292,7 @@ access ``DMatrix``:
def softprob_obj(labels: np.ndarray, predt: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
rows = labels.shape[0]
classes = predt.shape[1]
grad = np.zeros((rows, classes), dtype=float)
hess = np.zeros((rows, classes), dtype=float)
eps = 1e-6