Deeprank-GNN icon indicating copy to clipboard operation
Deeprank-GNN copied to clipboard

Support custom regression targets

Open erikedlund opened this issue 2 years ago • 0 comments

Sorry if I've missed something here, but I haven't found a way to use a custom target for regression that isn't one of the canned values (fnat, irmsd, lrmsd). I've created graphs and added targets according to the guidelines in the docs, but when I go to train/evaluate models (requesting metrics with binary=False) I get an error:

    train_metrics = model.get_metrics('train', threshold = 4.0, binary=False)
  File "/home/edlunde/Deeprank-GNN/deeprank_gnn/NeuralNet.py", line 579, in get_metrics
    return Metrics(pred, y, self.target, threshold, binary)
  File "/home/edlunde/Deeprank-GNN/deeprank_gnn/Metrics.py", line 130, in __init__
    raise ValueError('target must be capri_class on bin_class')
ValueError: target must be capri_class on bin_class

It looks like the Metrics module is only calculating regression metrics if the target is one of ['fnat', 'irmsd', 'lrmsd'] (line 188).

Is there a way to train/score regression models I'm missing? Thanks.

erikedlund avatar Jun 13 '22 18:06 erikedlund