This module contains functions to infer on the test set and generate the final submission file for Kaggle.

Infer on Test Set

infer_on_test_set[source]

infer_on_test_set(learn:Learner, path:Path, tta:bool=False, bs:int=64)

Infers on test CSV at path using learn, optionally performing TTA.

preds = infer_on_test_set(learn, path=test_csv_path)

Format Submission

format_submission[source]

format_submission(preds:Tensor, save_path:Union[Path, str])

Formats raw preds into submission CSV, saving at save_path.

fake_preds = torch.zeros(1821, 4)
save_path = format_submission(fake_preds, "TESTING.csv"); save_path
Path('TESTING.csv')

All-in-One Learner -> Submission Function

evaluate[source]

evaluate(learn:Learner, path:Path, name:str='submission.csv', tta:bool=False)

Evaluates learn on test CSV at path and saves as name, optionally applying TTA.