Skip to content

Instantly share code, notes, and snippets.

LiJunjie holysoros

View GitHub Profile
pavlov99 /
Created Nov 2, 2016
Dump xgboost trees visualisation to the file system in pdf format.
model = xgb.Booster(model_file='your.model')
model.feature_names = xgtrain.feature_names # Note: xgtrain is your train file with features.
model.feature_types = xgtrain.feature_types
# Number of trees in the model
num_trees = len(model.get_dump())
# dump all of the trees to tree folder
for tree_index in range(num_trees):
dot = xgb.to_graphviz(model, num_trees=tree_index)
labrown / elasticsearch-handlers-main.yml
Last active Apr 23, 2020
Ansible rolling restart of Elasticsearch Cluster
View elasticsearch-handlers-main.yml
# Elasticsearch Rolling restart using Ansible
## Why is this needed?
# Even if you use a serial setting to limit the number of nodes processed at one
kachayev /
Last active Jun 23, 2020
Channels Are Not Enough or Why Pipelining Is Not That Easy
import numpy as np
from matplotlib import pylab as plt
#from mpltools import style # uncomment for prettier plots
function definitions
# generate all bernoulli rewards ahead of time
def generate_bernoulli_bandit_data(num_samples,K):
obstschale /
Last active Jul 14, 2020
An Octave introduction cheat sheet.

Octave CheatSheet

GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)


  • not equal ~=
  • logical AND &&
roberto / _flash_messages.html.erb
Created Aug 13, 2012
Rails flash messages using Twitter Bootstrap
View _flash_messages.html.erb
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
<% end %>
xdite / gist:3106785
Created Jul 13, 2012
Speedup Rails Asset Pipeline precompile process
View gist:3106785
You can’t perform that action at this time.