def xgboost_problem_type(hyperparameters: dict) -> str:
    """ XGboost problem type finder

    The function finds the type of the problem that should be solved when using the xgboost method. The function uses
     the objective variable to find out what type of problem that should be solved

    :param dict hyperparameters: A dictionary that contains the hyperparameters which the selected training method
            needs to train the model.
    :return:
            - problem_to_solve: A string that defines the problem to solve: regression or classification.
    """

    try:
        # the default value of the objective is regression reg:squarederror.
        # Here the exception is caught to avoid that the objective is not given by the user
        objective = hyperparameters["objective"]
        if objective.startswith("reg"):
            problem_to_solve = "regression"
        else:
            problem_to_solve = "classification"
    except Exception as e:
        print(f"The objective is not defined. The default value is reg:squarederror. Error: {e}")
        problem_to_solve = "regression"
    return problem_to_solve