This PR enforces the specification of the model_type parameter (classification or regression) when creating an instance of the Model class. Previously, model_type defaulted to "classification", but this could lead to unintended behavior if the user did not explicitly specify the type of model.
Changes
Removed Default Value for model_type:
model_type is now a required parameter in the __init__ method of the Model class. Users must specify it when instantiating the class.
Added Validation Check for model_type:
A simple ValueError is raised if model_type is not "classification" or "regression", ensuring that the parameter is set to an accepted value.
# Check if model_type is provided and valid
if model_type not in ["classification", "regression"]:
raise ValueError("You must specify model_type as either 'classification' or 'regression'.")
This PR enforces the specification of the
model_type
parameter (classification
orregression
) when creating an instance of theModel
class. Previously,model_type
defaulted to"classification"
, but this could lead to unintended behavior if the user did not explicitly specify the type of model.Changes
Removed Default Value for
model_type
:model_type
is now a required parameter in the__init__
method of theModel
class. Users must specify it when instantiating the class.model_type
:ValueError
is raised ifmodel_type
is not"classification"
or"regression"
, ensuring that the parameter is set to an accepted value.