<jupyter_start><jupyter_text>Targets with low accuracy<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
pd.options.display.float_format = '{:.3f}'.format
plt.rcParams["figure.dpi"] = 150
sns.set(style='darkgrid')
from IPython.display import display
import warnings
warnings.simplefilter('ignore', UserWarning)
from pathlib import Path
plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams['mathtext.fontset'] = 'stix'
plt.rcParams["font.size"] = 15
plt.rcParams['figure.figsize'] = (6, 4)
from scipy import stats
data_dir = Path('../../../../../data/')
dataset_dir = data_dir / 'out' / 'dataset'
subset_name = 'target_subset_' + Path('.').resolve().parent.name
score_dir = dataset_dir / 'score' / 'subsets' / subset_name
assert score_dir.exists()
fig_dir = score_dir / 'fig' / 'accuracy'
fig_dir.mkdir(parents=True, exist_ok=True)
target_list = data_dir / 'interim' / f'{subset_name}.csv'
assert target_list.exists()
label_path = score_dir / 'label.csv'
label_df = pd.read_csv(label_path, index_col=0)
target_df = pd.read_csv(target_list, index_col=0)
df = pd.merge(label_df, target_df, left_on='Target', right_on='id', how='left')
df<jupyter_output><empty_output><jupyter_text>Targets with low maximum GDT_TS<jupyter_code>label = 'GDT_TS'
target_num = 20
gdtts_max_df = df.groupby('Target').apply(lambda x: x.loc[x[label].idxmax()]).sort_values(label)
display(gdtts_max_df.head(target_num))
sample_targets_low_max_gdtts = gdtts_max_df.head(target_num).index.to_list()
data = df.groupby('Target').filter(lambda x: x.name in sample_targets_low_max_gdtts)
method = 'pLDDT'
label = 'GDT_TS'
x, y = label, method
sns.relplot(data=data, x=x, y=y, kind='scatter', col='Target', col_wrap=5, col_order=sample_targets_low_max_gdtts, s=15)
data = df.groupby('Target').filter(lambda x: x.name in sample_targets_low_max_gdtts)
method = 'pTMscore'
label = 'GDT_TS'
x, y = label, method
sns.relplot(data=data, x=x, y=y, kind='scatter', col='Target', col_wrap=5, col_order=sample_targets_low_max_gdtts, s=15)<jupyter_output><empty_output><jupyter_text>Targets with a low GDT_TS model<jupyter_code>label = 'GDT_TS'
target_num = 20
gdtts_min_df = df.groupby('Target').apply(lambda x: x.loc[x[label].idxmin()]).sort_values(label)
display(gdtts_min_df.head(target_num))
sample_targets_with_low_gdtts = gdtts_min_df.head(target_num).index.to_list()
set(sample_targets_with_low_gdtts) - set(sample_targets_low_max_gdtts)<jupyter_output><empty_output><jupyter_text>Targets with low GDT_TS and high mean-LDDT<jupyter_code>df.query('GDT_TS < 0.6 and Mean_LDDT > 0.8')['Target'].unique()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14909638554216867, 'fraction_numerical': 0.009036144578313253, 'mean_word_length': 7.434920634920635, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '134394', 'license': 'MIT', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1040, 'n_words': 180, 'path': 'src/notebooks/datasets/how_eq_random_num_300_seed_0_exclude/accuracy/targets_low_accuracy.ipynb', 'repo_name': 'yutake27/MQAB4AF2', 'size': '2656'}