HistGradientBoostingClassifier

Excuse me, I have launched the code:

cv_results_hist_model = cross_validate(
    hist_model, data, target, cv=cv,
    scoring="neg_mean_absolute_error",
    return_estimator=True, return_train_score=True)
errors = -cv_results_hist_model["test_score"]
print(f"MAE on test sets:\n {errors}\n",
      f"mean +/- std: {errors.mean():.3f} +/- {errors.std():.3f} Watts")

It is for the Q4, very similar to Q2, but I have obtained nan as a result, do yo know If I need in the pipeline to include some preprocessor, or maybe drop the DatetimeIndex (I do not know how because DatetimeIndex is not a common column)? Thanks

Indeed the DatetimeIndex is an index and should not be used in the dataset.
If the issue is not this one, you might want to copy-paste the traceback obtain by passing error_score="raise" in the cross_validate function.