Predict Continues Variable using Tabular Learner?

What’s the best method to use to predicting a continuous variable using the Tabular Learner? I tried 2 methods (learn.get_preds and learn.predict), but I didn’t get predictions that seemed to be “good”.

If I try getting predictions for my test set I get all zero predictions:

learn.get_preds(ds_type=DatasetType.Test)

[tensor([[1.5600e-05],
[2.4830e-05],
[3.8757e-05],
…,
[4.8581e-06],
[4.4265e-06],
[9.5214e-05]]), tensor([0, 0, 0, …, 0, 0, 0])]

FYI - I have a dataset where the variable that I’m trying to predict is 0.001 most of the times, but in some cases (maybe 5% of the cases) it could be greater than 100 or even greater than 1000 in some rare cases (not sure if this is relevant to my problem somehow).

Here’s my jupyter notebook:
https://github.com/tomilsinszki/machine_learning/blob/master/rc3.ipynb

For the validation set get_preds() seem to work (you can see all the 0.001 values in the predictions):

learn.get_preds()

[tensor([[1.5217e-05],
[2.4279e-05],
[3.8366e-05],
…,
[5.0746e-06],
[4.4974e-06],
[9.7986e-05]]),
tensor([0.0010, 0.0010, 0.0010, …, 0.0010, 0.0010, 0.0010])]

I also tried the learn.predict method, but I’m not sure what that returns, but that does not look like useful predictions either.

Unfortunately the fastai jupiter notebooks for the lectures that are using the Tabular Learner do not seem to show how to generate predictions (they only show how to build the model).

Any help is appreciated.

1 Like