Skip to content

Instantly share code, notes, and snippets.

@aagnone3
Created October 30, 2020 00:20
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 aagnone3/4730f81dbce89bf9657654cd8872907f to your computer and use it in GitHub Desktop.
Save aagnone3/4730f81dbce89bf9657654cd8872907f to your computer and use it in GitHub Desktop.
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