846c2362e2846115145417d95373b2bec54510fb,plot.py,,,#,4

Before Change


    algo, algo_name, build_time, search_time, precision = line.strip().split("\t")
    all_data.setdefault(algo, []).append((algo_name, float(build_time), float(search_time), float(precision)))

for algo, data in all_data.iteritems():
    data.sort(key=lambda t: t[-2]) // sort by time
    xs = [t[-2] for t in data]
    ys = [t[-1] for t in data]

After Change


    all_data.setdefault(algo, []).append((algo_name, float(build_time), float(search_time), float(precision)))

colors = plt.cm.rainbow(numpy.linspace(0, 1, len(all_data)))
handles = []

for algo, color in zip(all_data.keys(), colors):
    data = all_data[algo]
    data.sort(key=lambda t: t[-2]) // sort by time
    xs = [t[-2] for t in data]
    ys = [t[-1] for t in data]
    ls = [t[0] for t in data]
    plt.plot(xs, ys, "o", label=algo, color=color)
    //for i, l in enumerate(ls):
    //    plt.annotate(ls[i], (xs[i], ys[i]), color="lightgray", fontsize=8)

    // Plot Pareto frontier
    xs, ys = [], []
    last_y = float("-inf")
    for t in data:
        y = t[-1]
        if y > last_y:
            last_y = y
            ys.append(t[-1])
            xs.append(t[-2])
    handle, = plt.plot(xs, ys, "o-", label=algo, color=color)
    handles.append(handle)

plt.gca().set_xscale("log")
plt.gca().set_title("Precision-Performance tradeoff - up and to the left is better")
plt.gca().set_xlabel("Time per query (s) - lower is better")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: erikbern/ann-benchmarks
Commit Name: 846c2362e2846115145417d95373b2bec54510fb
Time: 2015-06-02
Author: mail@erikbern.com
File Name: plot.py
Class Name:
Method Name:


Project Name: deepchem/deepchem
Commit Name: 50efccc10d7dd32caf913b7da3059551dd7739d6
Time: 2016-08-01
Author: apappu97@gmail.com
File Name: deepchem/splits/__init__.py
Class Name: StratifiedSplitter
Method Name: __generate_required_index


Project Name: Theano/Theano
Commit Name: 24e7ed3b8f62fd702b2fea624189f93d145ad8b5
Time: 2017-05-30
Author: nouiz@nouiz.org
File Name: theano/gof/fg.py
Class Name: FunctionGraph
Method Name: orderings


Project Name: nilmtk/nilmtk
Commit Name: 63ef8bfa3b63090437bd27bf1e04db7ae1eae3cf
Time: 2014-11-27
Author: jack-list@xlk.org.uk
File Name: nilmtk/stats/totalenergy.py
Class Name:
Method Name: get_total_energy