Skip to content

Instantly share code, notes, and snippets.

View khatribharat's full-sized avatar
🏠
Working from home

Bharat Khatri khatribharat

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am khatribharat on github.
  • I am khatribharat (https://keybase.io/khatribharat) on keybase.
  • I have a public key ASBSZmCGDD6wSCyEhhd23Q25G4yyGmeDLbKBDOlxF_pfUQo

To claim this, I am signing this object:

# 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; }'
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