<jupyter_start><jupyter_text>Build/Load model<jupyter_code>es = EarlyStopping(monitor='loss', patience=8, min_delta=0)
rlr = ReduceLROnPlateau(monitor='loss', factor=0.5, patience=4, verbose=1, min_lr=0.0000001)

gcn_model_params = {
    "num_layers": 3,
    "max_atoms": 70,
    "num_atom_features": 62,
    "num_atom_features_original": 62,
    "num_bond_features": 6,
    "max_degree": 5,
    "conv_width": [32, 64, 96],
    "fp_length": [96, 96, 96],
    "activ_enc": "selu",
    "activ_dec": "selu",
    "learning_rates": [0.001, 0.001, 0.001],
    "learning_rates_fp": [0.005, 0.005, 0.005],
    "losses_conv": {
        "neighbor_output": "mean_squared_error",
        "self_output": "mean_squared_error",
    },
    "lossWeights": {"neighbor_output": 1.0, "self_output": 1.0},
    "metrics": "mse",
    "loss_fp": "mean_squared_error",
    "enc_layer_names": ["enc_1", "enc_2", "enc_3"],
    'callbacks': [es, rlr],
    'adam_decay': 0.0005329142291371636,
    'beta': 5,
    'p': 0.004465204118126482
}
gcn = GCN(gcn_model_params)
model = gcn.build_combined_onehot()<jupyter_output>LAYER 0
WARNING:tensorflow:From /Users/panos/anaconda3/envs/biosyslab/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
LAYER 1
LAYER 2
WARNING:tensorflow:From /Users/panos/anaconda3/envs/biosyslab/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.<jupyter_text>Load Data<jupyter_code>base_path = '/Users/panos/Desktop/biolab'
target = 'p38'
# no need for manual changes in this cell
train_files = os.path.join(base_path, f'Data/{target}/data_crossval/fold_{{}}/train_{{}}.csv')
val_files = os.path.join(base_path, f'Data/{target}/data_crossval/fold_{{}}/val_cold_{{}}.csv')
weight_files = os.path.join(base_path, f'Data/{target}/{target}_AutoEnc_Model/First Run/Weights/weights_model_{{}}.h5')
train_sets = [pd.read_csv(train_files.format(i,i), index_col = 0) if 'Unnamed: 0' in pd.read_csv(train_files.format(i,i)) else pd.read_csv(train_files.format(i,i)) for i in range(1,8)]
val_sets = [pd.read_csv(val_files.format(i,i), index_col = 0) if 'Unnamed: 0' in pd.read_csv(val_files.format(i,i)) else pd.read_csv(val_files.format(i,i)) for i in range(1,8)]<jupyter_output><empty_output><jupyter_text>predict<jupyter_code>preds = []
for i, df_val in enumerate(val_sets):
    y_true = df_val.Binary
    input_data = gcn.dataframe_to_gcn_input(df_val)
    model.load_weights(weight_files.format(i,i))
    preds.append(model.predict(input_data))
dfs = []
for i, (y_pred, df_val) in enumerate(zip(preds, val_sets)):
    print(f'fold {i}\n')
    y_true = df_val.Binary
    dfs.append(calculate_metrics(y_true.values, y_pred.squeeze(), plots=True))
    metrics = pd.DataFrame(dfs)
metrics<jupyter_output>fold 0

predictions histogram
{'fraction_non_alphanumeric': 0.1511627906976744, 'fraction_numerical': 0.04242614707730987, 'mean_word_length': 5.44331983805668, 'pattern_counts': {'":': 21, '<': 11, '<?xml version=': 0, '>': 11, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '550708', 'license': 'MIT', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1221, 'n_words': 222, 'path': 'learning/.ipynb_checkpoints/model_performance_analysis-checkpoint.ipynb', 'repo_name': 'BioSysLab/kinase_binding', 'size': '3182'}