Class: Loss

eclairjs/mllib/tree/loss.Loss

new Loss()

Source:

Methods

computeError(modelOrPrediction, dataOrLabel) → {Promise.<Number>}

If TreeEnsembleModel, RDD parameters are supplied: Method to calculate error of the base learner for the gradient boosting calculation or Note: This method is not used by the gradient boosting algorithm but is useful for debugging purposes. If float, float parameters are supplied: Method to calculate loss when the predictions are already known. Note: This method is used in the method evaluateEachIteration to avoid recomputing the predicted values from previously fit trees.
Parameters:
Name Type Description
modelOrPrediction TreeEnsembleModel | float Model of the weak learner or predicted label (predict only valid with label param).
dataOrLabel module:eclairjs/rdd.RDD | float Training dataset: RDD of LabeledPoint or true label (use of label only valid with prediction param).
Source:
Returns:
Type
Promise.<Number>

gradient(prediction, label) → {Promise.<Number>}

Method to calculate the gradients for the gradient boosting calculation.
Parameters:
Name Type Description
prediction float
label float
Source:
Returns:
Type
Promise.<Number>