Skip to content

Instantly share code, notes, and snippets.

LiJunjie holysoros

View GitHub Profile
@pavlov99
pavlov99 / dump-xgboost-trees.py
Created Nov 2, 2016
Dump xgboost trees visualisation to the file system in pdf format.
View dump-xgboost-trees.py
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
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
kachayev / concurrency-in-go.md
Last active Jun 23, 2020
Channels Are Not Enough or Why Pipelining Is Not That Easy
View concurrency-in-go.md
View bandit_simulations.py
import numpy as np
from matplotlib import pylab as plt
#from mpltools import style # uncomment for prettier plots
#style.use(['ggplot'])
'''
function definitions
'''
# generate all bernoulli rewards ahead of time
def generate_bernoulli_bandit_data(num_samples,K):
@obstschale
obstschale / octave.md
Last active Jul 14, 2020
An Octave introduction cheat sheet.
View octave.md

Octave CheatSheet

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

Basics

  • not equal ~=
  • logical AND &&
@roberto
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 %>
</div>
<% end %>
@xdite
xdite / gist:3106785
Created Jul 13, 2012
Speedup Rails Asset Pipeline precompile process
View gist:3106785
View yardoc_cheatsheet.md
You can’t perform that action at this time.