Getting predictions get_preds() for test sets


#1

Hello

I have posted this on another part but perhaps it is too obvious but I can’t seem to find any answer to this trivial question.

If I run val_preds,val_targets = learn.get_preds() I get the predictions and targets for the validation set. How do I run it for the test set?

So far all the docs show learn.get_preds(is_test=True) but is_test has been changed to something else. Please advise !

Cheers, Hud


(ali baltschun) #2

i dont know for one liner

but its work fo me

preds = []
for i in range(0,30):
    p = learn.predict(data.test_ds.x[i])
    preds.append(str(p[0]))

(Sam Ariabod) #3

Hello, with v1 you can pass in the DatasetType to get_preds().

preds, y = learn.get_preds(DatasetType.Test)