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
type Blast struct { | |
requests uint64 // the number of successful requests | |
failures uint64 // the number of failed requests | |
started time.Time // the time the benchmark was started | |
duration time.Duration // the duration of the benchmark period | |
latencies []time.Duration // observed latencies in the number of requests | |
} | |
// Run N operations against the server at addr by putting a unique key with | |
// random values of size S. Returns a Benchmark object whose objects can be |
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
%matplotlib inline | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
from sklearn.datasets import make_regression | |
from sklearn.preprocessing import StandardScaler | |
from matplotlib.patches import Rectangle |
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
#!/usr/bin/env python3 | |
import argparse | |
from datetime import datetime, timedelta | |
try: | |
from dateutil.relativedelta import relativedelta | |
except ImportError: | |
relativedelta = None |
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
package main | |
import ( | |
"log" | |
"os" | |
) | |
func main() { | |
var ( | |
fobj *os.File |
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
package main | |
import ( | |
"fmt" | |
"strings" | |
"time" | |
) | |
var ( | |
count uint64 |
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 csv | |
from tabulate import tabulate | |
from operator import itemgetter | |
from collections import Counter | |
def parse_inner_csv(val): | |
return list( | |
map(lambda s: s.strip(), val.lower().split(",")) |
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 time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.datasets import make_regression | |
from sklearn.model_selection import train_test_split as tts | |
from sklearn.linear_model import LinearRegression | |
from yellowbrick.regressor import ResidualsPlot |
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
#!/bin/bash | |
# Execute the reveal.js slides form of a Notebook | |
# Make sure the first argument to this script is a notebook | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: ./slideshow.sh Notebook.ipynb" | |
exit 1 | |
fi | |
# Make sure the notebook exists |
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
#!/usr/bin/env python | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Ellipse, Circle | |
np.random.seed(42) | |
def draw_mahalanobis(path="atap_ch06_mahalanobis_distance.png"): |
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
#!/usr/bin/env python | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import MultipleLocator, FormatStrFormatter | |
def draw_distances(path="atap_ch06_euclidean_manhattan_distance.png"): |