Skip to content

Instantly share code, notes, and snippets.

@straussmaximilian
Created September 21, 2019 13:07
Show Gist options
  • Save straussmaximilian/51ddc87b03c4640b9479e8a4c40b2af9 to your computer and use it in GitHub Desktop.
Save straussmaximilian/51ddc87b03c4640b9479e8a4c40b2af9 to your computer and use it in GitHub Desktop.
def fixed_query(size):
"""
Returns a random array of given size and
a fixed number of random query points.
"""
array = random_array(size)
query_points = random_array(1e4)
return (array, query_points)
plt.figure(figsize=(10, 10))
plt.title('Quantitative Comparison, Fixed Query Size')
perfplot.show(
setup=fixed_query,
kernels=[kdtree, multiple_queries_index, multiple_queries],
n_range=[2**k for k in range(2, 22)],
logx=True,
logy=True,
equality_check=False,
xlabel='len(df)')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment