Skip to content

Commit df77e1b

Browse files
committed
random forest exercise code
1 parent bf96872 commit df77e1b

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

content/python_files/feature_engineering.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,13 +1129,11 @@ def plot_residuals_by_month(cv_predictions):
11291129
# %%
11301130
from sklearn.multioutput import MultiOutputRegressor
11311131

1132-
model = MultiOutputRegressor(
1133-
estimator=HistGradientBoostingRegressor(random_state=0), n_jobs=-1
1134-
)
1135-
1136-
# %%
11371132
multioutput_predictions = features_with_dropped_cols.skb.apply(
1138-
model, y=targets.skb.drop(cols=["prediction_time", "load_mw"]).skb.mark_as_y()
1133+
MultiOutputRegressor(
1134+
estimator=HistGradientBoostingRegressor(random_state=0), n_jobs=-1
1135+
),
1136+
y=targets.skb.drop(cols=["prediction_time", "load_mw"]).skb.mark_as_y(),
11391137
).skb.set_name("multioutput_gbdt")
11401138

11411139
# %%

0 commit comments

Comments
 (0)