8.4.5 Getting the Loss Value For a Pg2vec Model
You can fetch the training loss value on a specified fraction of training data (set in builder using setValidationFraction
) as described in the following code:
Getting the Loss Value Using
JShell
opg4j> var loss = model.getLoss();
Getting the Loss Value Using Java
double loss = model.getLoss();
Getting the Loss Value Using Python
loss = model.loss
Parent topic: Using the Pg2vec Algorithm