Class MatchboxRecommenderPredictionSettings
Settings of the Matchbox recommender which affect prediction.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Learners
Assembly: Microsoft.ML.Probabilistic.Learners.Recommender.dll
Syntax
[Serializable]
public class MatchboxRecommenderPredictionSettings : ICustomSerializable
Remarks
These settings can be modified after training.
Constructors
MatchboxRecommenderPredictionSettings()
Initializes a new instance of the MatchboxRecommenderPredictionSettings class.
Declaration
public MatchboxRecommenderPredictionSettings()
MatchboxRecommenderPredictionSettings(IReader)
Initializes a new instance of the MatchboxRecommenderPredictionSettings class from a reader of a binary stream.
Declaration
public MatchboxRecommenderPredictionSettings(IReader reader)
Parameters
Type | Name | Description |
---|---|---|
IReader | reader | The binary reader to read the prediction settings from. |
Fields
LossFunctionDefault
The default loss function.
Declaration
public const LossFunction LossFunctionDefault = LossFunction.ZeroOne
Field Value
Type | Description |
---|---|
LossFunction |
Methods
GetPredictionLossFunction(out Func<Int32, Int32, Double>)
Gets the loss function which determines how a prediction in the form of a distribution is converted into a point prediction.
Declaration
public LossFunction GetPredictionLossFunction(out Func<int, int, double> customLossFunction)
Parameters
Type | Name | Description |
---|---|---|
Func<Int32, Int32, Double> | customLossFunction | The custom loss function on integers. This is |
Returns
Type | Description |
---|---|
LossFunction | The LossFunction. |
Remarks
A loss function returns the loss incurred when choosing an estimate instead of the true value, where the first argument is the true value and the second argument is the estimate of the true value.
SaveForwardCompatible(IWriter)
Saves the prediction settings of the Matchbox recommender using the specified writer to a binary stream.
Declaration
public void SaveForwardCompatible(IWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IWriter | writer | The writer to save the prediction settings to. |
SetPredictionLossFunction(LossFunction, Func<Int32, Int32, Double>)
Sets the loss function which determines how a prediction in the form of a distribution is converted into a point prediction.
Declaration
public void SetPredictionLossFunction(LossFunction lossFunction, Func<int, int, double> customLossFunction = null)
Parameters
Type | Name | Description |
---|---|---|
LossFunction | lossFunction | The loss function. |
Func<Int32, Int32, Double> | customLossFunction | An optional custom loss function. This can only be set when |