<jupyter_start><jupyter_text>UMAP on the test dataset--------------------------------<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
import umap
import numba
import warnings

with warnings.catch_warnings():
    warnings.simplefilter('ignore', numba.errors.NumbaDeprecationWarning)

    
%matplotlib inline
sns.set(style='white', rc={'figure.figsize':(12,8)})
# np.random.seed(42)
# data = np.random.rand(800, 9)
print(data[0,:])
fit = umap.UMAP(random_state=42)
%time u = fit.fit_transform(data,y=data_color)
# plt.scatter(u[:,0], u[:,1], c=data)
plt.scatter(u[:,0], u[:,1],c=data_color,s=3)<jupyter_output><empty_output><jupyter_text>transform 1st time<jupyter_code>%time test_embedding = fit.transform(data_test)
plt.scatter(test_embedding[:,0], test_embedding[:,1],c=data_color_test,s=3)
plt.scatter(np.concatenate((u[:,0],test_embedding[:,0])), np.concatenate((u[:,1],test_embedding[:,1])),c=data_color,s=3)
plt.scatter(u[:,0], u[:,1],c=data_color_train,s=3)
import codecs, json
print(len(np.concatenate((u,test_embedding),axis=0)))
with open('processed_gene_data_normalized_category_umap_10_2_1.json', 'w') as outfile:
    json.dump(np.concatenate((u,test_embedding),axis=0).tolist(), outfile,separators=(',', ':'), sort_keys=True, indent=4)<jupyter_output>40900
{'fraction_non_alphanumeric': 0.1976225854383358, 'fraction_numerical': 0.03194650817236255, 'mean_word_length': 7.746753246753247, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '154326', 'license': 'MIT', 'n_tokens_mistral': 546, 'n_tokens_neox': 540, 'n_words': 72, 'path': 'TimeRadar/python/plot_UMAP-transform-test.ipynb', 'repo_name': 'iDataVisualizationLab/HPC_releases', 'size': '1346'}