示例#1
0
    def predict(self, dataset_type: str, preds_path: str, save_dir: str):
        # Set up command line arguments for predicting
        raw_predict_args = self.create_raw_predict_args(
            dataset_type=dataset_type,
            preds_path=preds_path,
            checkpoint_dir=save_dir
        )

        # Predict
        with patch('sys.argv', raw_predict_args):
            chemprop_predict()
示例#2
0
    def predict(self,
                dataset_type: str,
                preds_path: str,
                save_dir: str,
                model_type: str = 'chemprop',
                flags: List[str] = None):
        # Set up command line arguments
        raw_args = self.create_raw_predict_args(dataset_type=dataset_type,
                                                preds_path=preds_path,
                                                checkpoint_dir=save_dir,
                                                flags=flags)

        # Predict
        with patch('sys.argv', raw_args):
            command_line = ' '.join(raw_args[1:])

            if model_type == 'chemprop':
                print(f'python predict.py {command_line}')
                chemprop_predict()
            else:
                print(f'python sklearn_predict.py {command_line}')
                sklearn_predict()
示例#3
0
"""Loads a trained chemprop model checkpoint and makes predictions on a dataset."""

from chemprop.train import chemprop_predict

if __name__ == '__main__':
    chemprop_predict()
示例#4
0
"""Loads a trained chemprop model checkpoint and makes predictions on a dataset."""

from chemprop.train import chemprop_predict

if __name__ == '__main__':
    preds = chemprop_predict()
    print(preds)