<jupyter_start><jupyter_text>Import the data and see what it looks like<jupyter_code>a = pickle.load( open( "../Data/proc_physical_3sig.pkl", "rb" ) )
a[0].shape, a[1].shape, a[2]<jupyter_output><empty_output><jupyter_text>Data seems to be in a weird format so lets just play with the values<jupyter_code>from sklearn.neighbors import KDTree
X = a[0]
print(X.shape)<jupyter_output>(9992, 23)<jupyter_text>Make the tree and see how it works<jupyter_code>kdt = KDTree(X, leaf_size=40, metric='euclidean')
dist, ind = kdt.query(X, k=200, return_distance=True)
print(dist.shape)<jupyter_output>(9992, 200)<jupyter_text>Each point in the tree has a measured distance to the 200 nearest neighbors these are stored in order of proximity<jupyter_code>plt.plot(dist[8])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12025316455696203, 'fraction_numerical': 0.03417721518987342, 'mean_word_length': 7.505376344086022, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '156634', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 320, 'n_tokens_neox': 292, 'n_words': 74, 'path': 'src/Regression/kdtree_test.ipynb', 'repo_name': 'mattcwilde/astrokriging', 'size': '790'}