forked from chemprop/chemprop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsklearn_predict.py
31 lines (26 loc) · 1.59 KB
/
sklearn_predict.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from argparse import ArgumentParser
from chemprop.parsing import update_checkpoint_args
from chemprop.sklearn_predict import predict_sklearn
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--test_path', type=str, required=True,
help='Path to CSV file containing testing data for which predictions will be made')
parser.add_argument('--preds_path', type=str, required=True,
help='Path to CSV file where predictions will be saved')
parser.add_argument('--dataset_type', type=str, required=True, choices=['classification', 'regression'],
help='Type of dataset')
parser.add_argument('--model_type', type=str, choices=['random_forest', 'svm'], required=True,
help='scikit-learn model to use')
parser.add_argument('--checkpoint_path', type=str, default=None,
help='Path to model checkpoint (.pkl file)')
parser.add_argument('--checkpoint_dir', type=str, default=None,
help='Path to directory containing model checkpoints (.pkl file)')
parser.add_argument('--radius', type=int, default=2,
help='Morgan fingerprint radius')
parser.add_argument('--num_bits', type=int, default=2048,
help='Number of bits in morgan fingerprint')
parser.add_argument('--num_tasks', type=int, required=True,
help='Number of tasks the trained model makes predictions for')
args = parser.parse_args()
update_checkpoint_args(args, ext='pkl')
predict_sklearn(args)