<jupyter_start><jupyter_text>Construct Internal Test Set<jupyter_code>size = 0.10
seed = 6
np.random.seed(seed)
msk = np.random.rand(len(df)) < 0.1
df_tv = df[~msk]
df_int = df[msk]
print(df.shape, df_tv.shape, df_int.shape)
df_tv.to_csv(homedir+'tox_niehs_all_trainval.csv', index=False)
df_int.to_csv(homedir+'tox_niehs_all_int.csv', index=False)<jupyter_output><empty_output><jupyter_text>Evaluate Dataset Characteristics<jupyter_code>import matplotlib.pyplot as plt
task = 'verytoxic'

fig, axes = plt.subplots(nrows=1, ncols=3)

df[task].hist(normed=True, ax=axes[0])
df_tv[task].hist(normed=True, ax=axes[1])
df_int[task].hist(normed=True, ax=axes[2])
task = 'nontoxic'

fig, axes = plt.subplots(nrows=1, ncols=3)

df[task].hist(normed=True, ax=axes[0])
df_tv[task].hist(normed=True, ax=axes[1])
df_int[task].hist(normed=True, ax=axes[2])
task = 'epa'

fig, axes = plt.subplots(nrows=1, ncols=3)

df[task].hist(normed=True, ax=axes[0])
df_tv[task].hist(normed=True, ax=axes[1])
df_int[task].hist(normed=True, ax=axes[2])
task = 'ghs'

fig, axes = plt.subplots(nrows=1, ncols=3)

df[task].hist(normed=True, ax=axes[0])
df_tv[task].hist(normed=True, ax=axes[1])
df_int[task].hist(normed=True, ax=axes[2])
task = 'ld50'

fig, axes = plt.subplots(nrows=1, ncols=3)

df[task].hist(normed=True, ax=axes[0])
df_tv[task].hist(normed=True, ax=axes[1])
df_int[task].hist(normed=True, ax=axes[2])
task = 'logld50'

fig, axes = plt.subplots(nrows=1, ncols=3)

df[task].hist(normed=True, ax=axes[0])
df_tv[task].hist(normed=True, ax=axes[1])
df_int[task].hist(normed=True, ax=axes[2])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19477286869943994, 'fraction_numerical': 0.024891101431238332, 'mean_word_length': 8.62874251497006, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, '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': '510721', 'license': 'MIT', 'n_tokens_mistral': 778, 'n_tokens_neox': 744, 'n_words': 99, 'path': 'jupyter/ToxNet_02_Internal_Test_Set.ipynb', 'repo_name': 'Lenaxiao/ToxNet-Project', 'size': '1607'}