Unfortunately, I don’t know of a way to apply the transformations of the training dataframe to the test dataframe on individual columns only without transforming or copying the original dataframe. However, it’s worth considering using the test_dl method on the entire test dataframe and then calling learn.predict (docs) to get predictions. That way, you can make individual predictions instead of all predictions at once.
Another way to transform only a single row of data in the test dataframe would be to call test_dl on a new dataframe, which only contains one row (the one you want to predict) and follow up with get_preds or predict on this new DataLoader. However, I don’t see the advantage over the first approach in this, it may depend on the context though.
To summarize, you could consider using learn.predict instead of learn.get_preds to make individual predictions. If you require to only transform a single row and to make predictions, you could implement a workaround where you create a new dataframe with the desired row and call test_dl on this row.
This second method is how i was creating the dl for all my prediction dfs, so I have my concerns i was doing it all wrong. The second method will produce bogus results, is that correct?
If so, what I don’t understand is how to add new rows into the dataloader (i.e. new entries on which to make predicitons), so that it forms part of the entire dl set, without already having the data available???
Having thought about this a bit more… adding a new entry requires recreation of the entire test/train df and dls. Does that mean I would have to retrain the entire model each time i want to predict new entries?