<jupyter_start><jupyter_text>Now in 2-D<jupyter_code>n_samps = 200
x_samples = np.linspace(1,5,num=n_samps)
y_samples = np.linspace(2,4,num=n_samps)
z_samples = np.vstack([x_samples,y_samples])
b = get_covariance_matrix(z_samples)
kernel = lambda x1,x2: k*np.exp((-.5)*(dst.euclidean(x1,x2)**2)/l**2)

SIGMA = np.zeros([n_samps,n_samps])
for idx1,samp1 in enumerate(x_samples):
    
    for idx2,samp2 in enumerate(x_samples):
        
        SIGMA[idx1,idx2] = kernel(samp1,samp2)  #+= 1e-6
        #if idx1==idx2:
        #    SIGMA[idx1,idx2]
            
SIGMA += np.eye(SIGMA.shape[0])*1e-6
b==SIGMA
%%timeit
b = get_covariance_matrix(z_samples)
%%timeit
SIGMA = np.zeros([n_samps,n_samps])
for idx1,samp1 in enumerate(x_samples):
    
    for idx2,samp2 in enumerate(x_samples):
        
        SIGMA[idx1,idx2] = kernel(samp1,samp2)  #+= 1e-6
        #if idx1==idx2:
        #    SIGMA[idx1,idx2]
            
SIGMA += np.eye(SIGMA.shape[0])*1e-6<jupyter_output>1 loop, best of 3: 725 ms per loop
{'fraction_non_alphanumeric': 0.15522388059701492, 'fraction_numerical': 0.05373134328358209, 'mean_word_length': 3.5727272727272728, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '631091', 'license': 'MIT', 'n_tokens_mistral': 469, 'n_tokens_neox': 451, 'n_words': 65, 'path': 'distance calculation for faster cov_matrix stuff.ipynb', 'repo_name': 'yves-weissenberger/GPR', 'size': '1005'}