Skip to content

Instantly share code, notes, and snippets.

View Johnne32's full-sized avatar

Iwuozor John Johnne32

View GitHub Profile
params_xgb = {
'learning_rate': [.1, .05, ],
'colsample_bytree': [.3, .4, .5, .6],
'max_depth': [1],
'alpha': [3],
'subsample': [.5],
'n_estimators': [30, 70, 100, 200]
}
xgb_model = XGBRegressor()
# Import label encoder
from sklearn import preprocessing
label_encoder = preprocessing.LabelEncoder()
final_df['Type']= label_encoder.fit_transform(final_df['Type'])
final_df['City Group']= label_encoder.fit_transform(final_df['City Group'])
final_df.head()