Class SettingsGuard
Guards settings from being changed.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Learners
Assembly: Microsoft.ML.Probabilistic.Learners.dll
Syntax
[Serializable]
public class SettingsGuard : ICustomSerializable
Constructors
SettingsGuard(IReader, Func<Boolean>)
Initializes a new instance of the SettingsGuard class from a reader of a binary stream.
Declaration
public SettingsGuard(IReader reader, Func<bool> isImmutable)
Parameters
Type | Name | Description |
---|---|---|
IReader | reader | The reader to load the SettingsGuard from. |
Func<Boolean> | isImmutable | If true, the setting cannot be changed. |
SettingsGuard(Func<Boolean>, String)
Initializes a new instance of the SettingsGuard class.
Declaration
public SettingsGuard(Func<bool> isImmutable, string message = "This setting cannot be changed.")
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | isImmutable | If true, the setting cannot be changed. |
String | message | The message shown when trying to change an immutable setting. |
Methods
OnSettingChanging()
Performs actions required before the value of a training setting is about to be changed.
Declaration
public void OnSettingChanging()
SaveForwardCompatible(IWriter)
Saves the state of the SettingsGuard 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 state of the SettingsGuard to. |