异常 hscredit.exceptions

所有自定义异常均继承自 HSCreditError,便于统一捕获。

hscredit 统一异常体系.

提供项目级的异常类型,兼容原生异常语义,方便调用方统一捕获。

exception hscredit.exceptions.HSCreditError[源代码]

基类:Exception

hscredit 的基础异常类型。

exception hscredit.exceptions.ValidationError[源代码]

基类:ValueError, HSCreditError

参数或数据校验失败。

exception hscredit.exceptions.InputValidationError[源代码]

基类:ValidationError

输入数据校验失败。

exception hscredit.exceptions.InputTypeError[源代码]

基类:TypeError, HSCreditError

输入类型不符合要求。

exception hscredit.exceptions.FeatureNotFoundError[源代码]

基类:KeyError, HSCreditError

特征或字段不存在。

exception hscredit.exceptions.StateError[源代码]

基类:RuntimeError, HSCreditError

对象状态不符合预期。

exception hscredit.exceptions.ParallelExecutionError[源代码]

基类:StateError

并行任务执行失败。

exception hscredit.exceptions.NotFittedError[源代码]

基类:ValueError, StateError

对象尚未完成拟合。

exception hscredit.exceptions.DependencyError[源代码]

基类:ImportError, HSCreditError

缺少可选依赖。

exception hscredit.exceptions.SerializationError[源代码]

基类:HSCreditError

序列化或反序列化失败。

hscredit.exceptions.raise_not_fitted(component_name, action='请先调用fit方法')[源代码]

抛出统一的未拟合异常。

参数:
  • component_name (str)

  • action (str)

返回类型:

None

hscredit.exceptions.raise_feature_not_found(feature_name, owner_name='特征')[源代码]

抛出统一的字段不存在异常。

参数:
  • feature_name (str)

  • owner_name (str)

返回类型:

None

hscredit.exceptions.raise_missing_columns(columns, data_name='数据集')[源代码]

抛出统一的缺失字段异常。

参数:
  • columns (Iterable[str])

  • data_name (str)

返回类型:

None