Loading...

verticapy.errors.ModelError#

exception verticapy.errors.ModelError#

An exception raised when an error occurs during the modeling process, indicating issues such as invalid model configurations, incompatible data, or challenges in the training or prediction phase. This error is typically encountered in machine learning contexts when there are issues with the model’s structure, data, or parameters.

Examples#

The following function checks if the input model is supported.

from verticapy.errors import ModelError

def is_supported_model(model_type: str):

    if model_type.lower() not in ('linear_reg', 'logistic_reg'):

        raise OptionError(
            f"The model type '{model_type}' is not yet supported."
        )

Note

Errors can be employed when implementing new functions to provide clear explanations for why a particular option or feature is not functioning as intended. It is essential to review all available errors to choose the most appropriate one.