Inference Learner for collaborative filtering

What’s the best way to try out my trained collab_learner on a test set?

Is this the way to do it?.

preds= learn.get_preds(ds_type=DatasetType.Test)
preds = preds[0].numpy()

I want my test preds as a numpy array.
The test set was specified when creating the CollabDataBunch instance.

data = CollabDataBunch.from_df(data_train, seed=42, path=path, test=data_test)

That seems about right.

How should the test dataset be provided?
For example if the train set has 1000 users and 1000 movies. And the test set has only 1 user with 999 movie reviews. Should that one movie what is not rated presented with a NaN value?

I think it’s the other way round, but any value in your test set that isn’t in your training set should be replaced by NaN.