Skip to content

ConvergenceError

Module: strata.utils • Kind: struct • Traits: Copyable, Movable, Writable
Source: strata/exceptions/errors.mojo

struct ConvergenceError(Copyable, Movable, Writable)
from strata.utils import ConvergenceError

Exception raised when iterative optimization fails to converge within max iterations.


Method Description
ConvergenceError.error() Create a formatted ConvergenceError message.
ConvergenceError.write_to() Format a human-readable string representation to a writer.

def error(
estimator_name: String,
max_iter: Int,
loss: Float64 = 0.0,
) -> Error

Create a formatted ConvergenceError message.

Parameter Type Description
estimator_name String —
max_iter Int —
loss Float64 —

Returns: Error


def write_to(self, mut writer: Some[Writer])

Format a human-readable string representation to a writer.