Problem prediction columnar data


(Anders) #1

After course DL1:4 (Rossmann structured data) I try to train a NN on some synthetic data. 300.000 rows of random variables between 0 and 100.
E.g.
A, B, C
50, 2, 81

My dependend variable is A + B + C. So I expect the NN to roughly predict Y = A+B+C.

Then I found out that ColumnarModelData.from_data_frame MUST have categorical data, so I added a dummy column ‘voidCats’ and set the column to string ‘None’.
Then I set the types, normalize, proc_df(), etc. and this is my dataframe:
image

This is my learning rate
image

But when I try to do a prediction I run into trouble:

test_ds = ColumnarDataset.from_data_frame(df[:1],cat_flds=‘voidCats’)
test_dl = DataLoader(test_ds)
preds = m.predict_dl(test_dl)

The first line fails with:

~/fastai/courses/dl1/fastai/column_data.py in (.0)
39 @classmethod
40 def from_data_frames(cls, df_cat, df_cont, y=None, is_reg=True, is_multi=False):
—> 41 cat_cols = [c.values for n,c in df_cat.items()]
42 cont_cols = [c.values for n,c in df_cont.items()]
43 return cls(cat_cols, cont_cols, y, is_reg, is_multi)

AttributeError: ‘int’ object has no attribute ‘values’

Did I mess something up the dummy-category?