This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to re-create commit activity graphs for YARN, MapReduce, HDFS, and Spark. | |
# This example shows the last 60 days of activity. | |
git clone https://github.com/apache/hadoop-common.git | |
cd hadoop-common | |
# MapReduce (commits, inserted, deleted) | |
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep MAPREDUCE | grep insertion | wc | |
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep MAPREDUCE | grep insertion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }' | |
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep MAPREDUCE | grep deletion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from matplotlib import pylab as plt | |
#from mpltools import style # uncomment for prettier plots | |
#style.use(['ggplot']) | |
# generate all bernoulli rewards ahead of time | |
def generate_bernoulli_bandit_data(num_samples,K): | |
CTRs_that_generated_data = np.tile(np.random.rand(K),(num_samples,1)) | |
true_rewards = np.random.rand(num_samples,K) < CTRs_that_generated_data | |
return true_rewards,CTRs_that_generated_data |