Skip to main content
Version: 8.1

IMLPredictionSaver class

Level: advanced

The IMLPredictionSaver utility class assists in saving the prediction results to the object.

Methods

SaveEntityPredictedValues(
Guid schemaUId,
Guid entityId,
Dictionary<MLModelConfig, List<ClassificationResult>> predictedValues,
Func<Entity, string, ClassificationResult, bool> onSetEntityValue
)

Save the MLEntityPredictor.ClassifyEntityValues classification results in the object. Out of the box, save only the result whose Significance property equals "High." If you need, override base business logic using the passed onSetEntityValue delegate. If the delegate returns false, the value is not recorded to the object.

Parameters

schemaUId

The unique ID of the object schema where the prediction results are saved.

entityId

The unique ID of the object record that receives the prediction results.

predictedValues

A collection of prediction results.

The key is the ML model configuration used for prediction.

The value is a list of classification results returned by the model.

onSetEntityValue

A delegate that defines custom business logic for saving predicted values to the object.

ClassificationResult properties

Value

Field value.

Probability

The probability of a received value in the [0:1] range. The sum of the probabilities for one list of results is close to 1. Values ​​of about 0 can be omitted.

Significance

The importance level of the prediction.

Available values

High

A distinct advantage over other values ​​from the list. Only one element in the prediction list can have this level.

Medium

The value of the field is close to several other high values ​​in the list. For example, two values ​​in the list have a probability of 0.41 and 0.39, and all the others are significantly smaller.

None

Irrelevant values ​that have low probabilities.