If you have 10 tests sets, you can just make a loop over the data creation (using the i-th test set in add_test) then change the data object under your learner with learn.data = new_data before running
FYI, for others struggling with this: this did not work in version '1.0.39 (got an error: RuntimeError: running_mean should contain 36 elements not 20)
According to the docs, one should be able to call .predict() on a trained learner passing in a novel dataframe containing your cat_names and cont_names variables. However that doesn’t seem to be working:
def dl(self, ds_type:DatasetType=DatasetType.Valid)->DeviceDataLoader:
"Returns appropriate `Dataset` for validation, training, or test (`ds_type`)."
#TODO: refactor
return (self.train_dl if ds_type == DatasetType.Train else
self.test_dl if ds_type == DatasetType.Test else
self.valid_dl if ds_type == DatasetType.Valid else
self.single_dl if ds_type == DatasetType.Single else
self.fix_dl)
The return statement dies with the following error when you pass tabular learner.predict() a pandas dataframe:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Please ignore the above. I was using .get_preds rather than .predict
Pandas follows the numpy convention of raising an error when you try to convert something to a bool. This happens in a if or when using the boolean operations, and, or, or not. It is not clear what the result of.
example
5 == pd.Series([12,2,5,10])
The result you get is a Series of booleans, equal in size to the pd.Series in the right hand side of the expression. So, you get an error. The problem here is that you are comparing a pandas pd.Series with a value, so you’ll have multiple True and multiple False values, as in the case above. This of course is ambiguous, since the condition is neither True or False. You need to further aggregate the result so that a single boolean value results from the operation. For that you’ll have to use either any or all depending on whether you want at least one (any) or all values to satisfy the condition.