Hello,
When I repeat the implementation, the score I get oscillates typically between 0.71 and 0.73. Occasionally I obtained 0.74 but it happened only once. These variations finally induced me to choose the “wrong” answer.
Here are my steps below , could you indicate me any mistake ? Thanks in advance.
scaler_imputer_transformer = make_pipeline(StandardScaler(), SimpleImputer(strategy="mean"))
imputer_ordinal_transformer = make_pipeline(SimpleImputer(strategy="constant",fill_value="missing"),
OrdinalEncoder(handle_unknown="use_encoded_value",unknown_value=-1))
preprocessor = ColumnTransformer(transformers=[
("cat-preprocessor", imputer_ordinal_transformer, categorical_columns),
("num-preprocessor", scaler_imputer_transformer, numerical_features)
])
model = make_pipeline(preprocessor, DecisionTreeRegressor())
cv_results = cross_validate(model, data, target, cv=10)