MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / eval_train

Method eval_train

python-package/lightgbmmt/basic.py:2165–2194  ·  view source on GitHub ↗

Evaluate for training data. Parameters ---------- feval : callable or None, optional (default=None) Customized evaluation function. Should accept two parameters: preds, train_data, and return (eval_name, eval_result, is_higher_better) or l

(self, feval=None)

Source from the content-addressed store, hash-verified

2163 return self.__inner_eval(name, data_idx, feval)
2164
2165 def eval_train(self, feval=None):
2166 """Evaluate for training data.
2167
2168 Parameters
2169 ----------
2170 feval : callable or None, optional (default=None)
2171 Customized evaluation function.
2172 Should accept two parameters: preds, train_data,
2173 and return (eval_name, eval_result, is_higher_better) or list of such tuples.
2174
2175 preds : list or numpy 1-D array
2176 The predicted values.
2177 train_data : Dataset
2178 The training dataset.
2179 eval_name : string
2180 The name of evaluation function (without whitespaces).
2181 eval_result : float
2182 The eval result.
2183 is_higher_better : bool
2184 Is eval result higher better, e.g. AUC is ``is_higher_better``.
2185
2186 For multi-class task, the preds is group by class_id first, then group by row_id.
2187 If you want to get i-th row preds in j-th class, the access way is preds[j * num_data + i].
2188
2189 Returns
2190 -------
2191 result : list
2192 List with evaluation results.
2193 """
2194 return self.__inner_eval(self._train_data_name, 0, feval)
2195
2196 def eval_valid(self, feval=None):
2197 """Evaluate for validation data.

Callers 2

trainFunction · 0.95
testMethod · 0.95

Calls 1

__inner_evalMethod · 0.95

Tested by 1

testMethod · 0.76