Skip to content

Instantly share code, notes, and snippets.

@Gabrieliam
Last active August 7, 2020 17:08
Show Gist options
  • Save Gabrieliam/ec4e0a426690fa78fcea36b4af33d89f to your computer and use it in GitHub Desktop.
Save Gabrieliam/ec4e0a426690fa78fcea36b4af33d89f to your computer and use it in GitHub Desktop.
#Create a classification model with set parameters, and then instead of fitting,
#load my model from the included JSON
classification_model = xgb.XGBClassifier(objective="binary:logistic", random_state=42, learning_rate = 0.05, n_estimators = 5000, early_stopping_rounds = 10)
classification_model.load_model('graph_classifier_3.json')
#Make a prediction
pred = classification_model.predict(embeddingsframe)
print(screen_name + ': ' + pred[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment