This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lightgbm_custom_obj_lambdarank(preds, train_data, first_order=False, constant_hessian=1.0): | |
''' | |
:param preds: numpy.ndarray of shape (size_data, ) | |
:param train_data: | |
:return: | |
''' | |
all_labels = train_data.get_label() # numpy.ndarray of shape (size_data, ) | |
group = train_data.get_group() # numpy.ndarray of shape (num_queries, ) | |
size_data = len(all_labels) |