Excuse me, I have launched the code:
from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import HistGradientBoostingClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.impute import SimpleImputer
hist_model = make_pipeline(StandardScaler(), SimpleImputer(strategy="constant", fill_value="missing"), HistGradientBoostingClassifier(
max_iter=1000, early_stopping=True, random_state=0
))
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")
And the result after is:
MAE on test sets:
[nan nan nan nan]
mean +/- std: nan +/- nan Watts
I do not know why “nan”.
Can you please help me? Thanks