ml3m.errors: Customized Exceptions

This file is for customizing exceptions.

exception ml3m.errors.InvalidParameterError(param_name: str, *, actual: Any | None = None, reason: str | None = None)[source]

Bases: Exception

Exception for invalid parameters.

Parameters

param_name: str

The name of the invalid parameter.

actualAny, optional

The actual value of the invalid parameter. If None, this is not revealed in the error message.

reasonstr, optional

The reason why the parameter is invalid. If None, this is not revealed in the error message.

exception ml3m.errors.ScoringError[source]

Bases: Exception

Exception when scoring.

ScoringError can happen mainly in the following cases:

  • In an evaluator, the score obtained is not a real value, or the scores obtained are not represented as a dictionary with real values.

  • In an evaluator, there are multiple subjects assigned, but only a single score obtained.

  • In an evaluator, there exist assigned subjects that are not found in the obtained scores.