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()
"""Loads a trained sklearn model checkpoint and makes predictions on a dataset.""" from chemprop.sklearn_predict import sklearn_predict if __name__ == '__main__': sklearn_predict()