System:
Create some random data:
In [1]:
import numpy as np
from sklearn.datasets import make_classification
data0,y = make_classification(n_samples=10000)
data1,z = make_classification(n_samples=10000)
In [2]:
from ckdtreebench import spatial_015
from ckdtreebench import spatial_016
from ckdtreebench import spatial_PR4890
In [3]:
%timeit spatial_015.cKDTree(data0)
In [4]:
%timeit spatial_016.cKDTree(data0, balanced_tree=False)
In [5]:
%timeit spatial_016.cKDTree(data0, balanced_tree=True)
In [6]:
%timeit spatial_PR4890.cKDTree(data0, balanced_tree=False)
In [7]:
%timeit spatial_PR4890.cKDTree(data0, balanced_tree=True)
In [8]:
kdtree = spatial_015.cKDTree(data0)
In [9]:
%timeit kdtree.query(data1, k=5)
In [10]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=False)
In [11]:
%timeit kdtree.query(data1, k=5)
In [12]:
%timeit kdtree.query(data1, k=5, n_jobs=-1)
In [13]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=True)
In [14]:
%timeit kdtree.query(data1, k=5)
In [15]:
%timeit kdtree.query(data1, k=5, n_jobs=-1)
In [16]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=False)
In [17]:
%timeit kdtree.query(data1, k=5)
In [18]:
%timeit kdtree.query(data1, k=5, n_jobs=-1)
In [19]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=True)
In [20]:
%timeit kdtree.query(data1, k=5)
In [21]:
%timeit kdtree.query(data1, k=5, n_jobs=-1)
In [22]:
kdtree = spatial_015.cKDTree(data0)
In [23]:
%timeit kdtree.query_ball_point(data1,4.0)
In [24]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=False)
In [25]:
%timeit kdtree.query_ball_point(data1,4.0)
In [26]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=True)
In [27]:
%timeit kdtree.query_ball_point(data1,4.0)
In [28]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=False)
In [29]:
%timeit kdtree.query_ball_point(data1,4.0)
In [30]:
%timeit kdtree.query_ball_point(data1,4.0,n_jobs=-1)
In [31]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=True)
In [32]:
%timeit kdtree.query_ball_point(data1,4.0)
In [33]:
%timeit kdtree.query_ball_point(data1,4.0,n_jobs=-1)
In [34]:
kdtree = spatial_015.cKDTree(data0)
other = spatial_015.cKDTree(data1)
In [35]:
%timeit kdtree.query_ball_tree(other,4.0)
In [36]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=False)
other = spatial_016.cKDTree(data1, balanced_tree=False)
In [37]:
%timeit kdtree.query_ball_tree(other,4.0)
In [38]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=True)
other = spatial_016.cKDTree(data1, balanced_tree=True)
In [39]:
%timeit kdtree.query_ball_tree(other,4.0)
In [40]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=False)
other = spatial_PR4890.cKDTree(data1, balanced_tree=False)
In [41]:
%timeit kdtree.query_ball_tree(other,4.0)
In [42]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=True)
other = spatial_PR4890.cKDTree(data1, balanced_tree=True)
In [43]:
%timeit kdtree.query_ball_tree(other,4.0)
In [44]:
kdtree = spatial_015.cKDTree(data0)
other = spatial_015.cKDTree(data1)
In [45]:
%timeit kdtree.count_neighbors(other,4.0)
In [46]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=False)
other = spatial_016.cKDTree(data1, balanced_tree=False)
In [47]:
%timeit kdtree.count_neighbors(other,4.0)
In [48]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=True)
other = spatial_016.cKDTree(data1, balanced_tree=True)
In [49]:
%timeit kdtree.count_neighbors(other,4.0)
In [50]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=False)
other = spatial_PR4890.cKDTree(data1, balanced_tree=False)
In [51]:
%timeit kdtree.count_neighbors(other,4.0)
In [52]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=True)
other = spatial_PR4890.cKDTree(data1, balanced_tree=True)
In [53]:
%timeit kdtree.count_neighbors(other,4.0)
In [54]:
kdtree = spatial_015.cKDTree(data0)
In [55]:
%timeit kdtree.query_pairs(4.0)
In [56]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=False)
In [57]:
%timeit kdtree.query_pairs(4.0)
In [58]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=True)
In [59]:
%timeit kdtree.query_pairs(4.0)
In [60]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=False)
In [61]:
%timeit kdtree.query_pairs(4.0, output_type='set')
In [62]:
%timeit kdtree.query_pairs(4.0, output_type='ndarray')
In [63]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=True)
In [64]:
%timeit kdtree.query_pairs(4.0, output_type='set')
In [65]:
%timeit kdtree.query_pairs(4.0, output_type='ndarray')
In [66]:
kdtree = spatial_015.cKDTree(data0)
other = spatial_015.cKDTree(data1)
In [67]:
%timeit kdtree.sparse_distance_matrix(other, 4.0)
In [68]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=False)
other = spatial_016.cKDTree(data1, balanced_tree=False)
In [69]:
%timeit kdtree.sparse_distance_matrix(other, 4.0)
In [70]:
kdtree = spatial_016.cKDTree(data0, balanced_tree=True)
other = spatial_016.cKDTree(data1, balanced_tree=True)
In [71]:
%timeit kdtree.sparse_distance_matrix(other, 4.0)
In [72]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=False)
other = spatial_PR4890.cKDTree(data1, balanced_tree=False)
In [73]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='dok_matrix')
In [74]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='coo_matrix')
In [75]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='dict')
In [76]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='recarray')
In [77]:
kdtree = spatial_PR4890.cKDTree(data0, balanced_tree=True)
other = spatial_PR4890.cKDTree(data1, balanced_tree=True)
In [78]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='dok_matrix')
In [79]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='coo_matrix')
In [80]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='dict')
In [81]:
%timeit kdtree.sparse_distance_matrix(other, 4.0, output_type='recarray')