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
dataName
Name of data used for early stopping.
metricName
Metric to look for.
stoppingRounds
Number of rounds to check improvence for.
state
Initial state.
verbose
Print on new best or stopping.
-
Declaration
Swift
public convenience init( dataName: String, metricName: String, stoppingRounds: Int, maximize: Bool = false, verbose: Bool = false )
Parameters
dataName
Name of data used for early stopping.
metricName
Metric to look for.
stoppingRounds
Number of rounds to check improvence for.
maximize
If metric should be maximized, minimzed otherwise.
verbose
Print on new best or stopping.
-
Declaration
Swift
public convenience init( dataName: String, metricName: String, stoppingRounds: Int, maximize: Bool, booster: Booster, verbose: Bool = false ) throws
Parameters
dataName
Name of data used for early stopping.
metricName
Metric to look for.
stoppingRounds
Number of rounds to check improvence for.
maximize
If metric should be maximized, minimzed otherwise.
booster
Booster to load state from.
verbose
Print on new best or stopping.
-
Call used in Booster training.
Declaration
Swift
public func call( booster: Booster? = nil, iteration: Int, evaluation: Evaluation? ) throws -> AfterIterationOutput
Parameters
booster
Booster.
iteration
Current iteration.
evaluation
Dictionary with evaluations.
-
Call used in cross-validation training.
Declaration
Swift
public func call( iteration: Int, evaluation: CVEvaluation ) throws -> AfterIterationOutput
Parameters
iteration
Current iteration.
evaluation
Cross-validation evaluation.