Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sf_crime_14.py
params = {
'boosting': 'gbdt',
'objective': 'binary',
'is_unbalance': True,
'num_class': 1,
'learning_rate': 0.1,
}
train_data = lgb.Dataset(X_train, label=y_train, categorical_feature=['PdDistrict'])
model = lgb.train(params, train_data, 250)
y_train_pred = model.predict(X_train)
y_pred = model.predict(X_validation)
joblib.dump(model, "model.jbl")
print("Saved trained model")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment