EarlyStopping
public class EarlyStopping : Callback
Class used for early stopping feature.
-
Name of the callback.
Declaration
Swift
public var name: String -
Position of the execution.
Declaration
Swift
public var execute: [LoopPosition] -
Typealais for tuple holding current state.
Declaration
Swift
public typealias State = ( maximizeScore: Bool, bestIteration: Int, bestScore: Float, bestMsg: String ) -
Current state of training.
Declaration
Swift
public var state: State -
Name of watched DMatrix.
Declaration
Swift
public var dataName: String -
Name of watched metric.
Declaration
Swift
public var metricName: String -
Number of stopping rounds.
Declaration
Swift
public var stoppingRounds: Int -
If true, statistics will be printed.
Declaration
Swift
public var verbose: Bool -
Declaration
Swift
public required init( dataName: String, metricName: String, stoppingRounds: Int, state: State, verbose: Bool = false )Parameters
dataNameName of data used for early stopping.
metricNameMetric to look for.
stoppingRoundsNumber of rounds to check improvence for.
stateInitial state.
verbosePrint on new best or stopping.
-
Declaration
Swift
public convenience init( dataName: String, metricName: String, stoppingRounds: Int, maximize: Bool = false, verbose: Bool = false )Parameters
dataNameName of data used for early stopping.
metricNameMetric to look for.
stoppingRoundsNumber of rounds to check improvence for.
maximizeIf metric should be maximized, minimzed otherwise.
verbosePrint on new best or stopping.
-
Declaration
Swift
public convenience init( dataName: String, metricName: String, stoppingRounds: Int, maximize: Bool, booster: Booster, verbose: Bool = false ) throwsParameters
dataNameName of data used for early stopping.
metricNameMetric to look for.
stoppingRoundsNumber of rounds to check improvence for.
maximizeIf metric should be maximized, minimzed otherwise.
boosterBooster to load state from.
verbosePrint on new best or stopping.
-
Call used in Booster training.
Declaration
Swift
public func call( booster: Booster? = nil, iteration: Int, evaluation: Evaluation? ) throws -> AfterIterationOutputParameters
boosterBooster.
iterationCurrent iteration.
evaluationDictionary with evaluations.
-
Call used in cross-validation training.
Declaration
Swift
public func call( iteration: Int, evaluation: CVEvaluation ) throws -> AfterIterationOutputParameters
iterationCurrent iteration.
evaluationCross-validation evaluation.
View on GitHub
EarlyStopping Class Reference