Skip to content

Instantly share code, notes, and snippets.

@ogyalcin
Created June 24, 2021 08:49
Show Gist options
  • Save ogyalcin/423516db76d326258a398e12293cb77b to your computer and use it in GitHub Desktop.
Save ogyalcin/423516db76d326258a398e12293cb77b to your computer and use it in GitHub Desktop.
from sklearn.ensemble import RandomForestRegressor
y = df.target
X = df.drop('target', axis=1)
# Train a Random Forest Regressor model
rf = RandomForestRegressor(random_state=42, n_estimators=50, n_jobs=-1)
rf.fit(X, y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment