Skip to content

Instantly share code, notes, and snippets.

Created April 7, 2021 10:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
target = train.pop('target')
for i in train.columns:
if train[i].dtype == 'object':
label = LabelEncoder()[i].values)+list(test[i].values))
train[i] = label.transform(train[i].values)
test[i] = label.transform(test[i].values)
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(train, target, test_size=0.1, random_state=0)
from lightgbm import LGBMClassifier
model = LGBMClassifier(random_state=0, metric='auc'), y_train)
y_pred = model.predict_proba(x_test)[:, 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment