Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created January 26, 2021 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/cd8f3d8673489948b20abcf73e599507 to your computer and use it in GitHub Desktop.
Save amankharwal/cd8f3d8673489948b20abcf73e599507 to your computer and use it in GitHub Desktop.
targets = targets/maxValLikes
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
xTrain, xTest, yTrain, yTest = train_test_split(features, targets, test_size = 0.1, random_state = 42)
stdSc = StandardScaler()
xTrain = stdSc.fit_transform(xTrain)
xTest = stdSc.transform(xTest)
from sklearn.ensemble import GradientBoostingRegressor
gbr = GradientBoostingRegressor()
gbr.fit(xTrain, yTrain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment