Skip to content

Instantly share code, notes, and snippets.

@pycaret
Created July 2, 2020 15:42
Show Gist options
  • Save pycaret/e203eee47ffed7e9910ce0bb6e8be50f to your computer and use it in GitHub Desktop.
Save pycaret/e203eee47ffed7e9910ce0bb6e8be50f to your computer and use it in GitHub Desktop.
# Importing dataset
from pycaret.datasets import get_data
credit = get_data('credit')
# Importing module and initializing setup
from pycaret.classification import *
clf1 = setup(data = credit, target = 'default')
# create a model
xgboost = create_model('xgboost')
# optimize threshold for trained model
optimize_threshold(xgboost, true_negative = 1500, false_negative = -5000)
@shuaiwang88
Copy link

Hi Moez,
what does 1500 and -5000 mean? Dollar value?
If I'd to have a high precision in the model, should I increase or decrease probability_threshold?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment