I am using a TabularDataBunch with get_tabular_learner. But to improve my model I need 2 different dependent variables.
Is there any way to do that?
@kardon you should pass an array of dependent variables to .label_from_df(cols=[var_1, var_2])
Hi, just curious, were you able to figure out how to do this?
Iāve been failing to add multiple dependent variables to @muellerzrās Practical Deep Learning for Coders -> 02 Regression and Permutation Importance (Rossmann Sales).
In-case anyone is interested in checking out his work:
Hereās my problem. I try to replace dep_var in the to TabularPandas part with pyplās suggestion.
to = TabularPandas(train_df, procs, cat_vars, cont_vars,.label_from_df(cols=[dep_var]), y_block=RegressionBlock(), splits=splits, inplace=True, reduce_memory=True)
That returns syntax error: invalid syntax.
In addition, I replaced dep_var with y_names as other notebooks in the same repository seemed to prefer. Failed.
The eventual goal is to add multiple dependent variables. The asset returns and previous year returns (with ā1ā after the name are attached on the github noted below.
dep_var =āinfā, āTbondRateā, āTbillRateā, āTbillReturnā, āTbondReturnā, āHomesAverageā, āOilā, āGoldā, āSPYā
Progress in the readme at my github.
You, the fast.ai forums, are my last hope. Could you explain this to my as if Iām an alien baby?
You are not, IIRC I had a tough time with multiple dependent variables as well. If I remember correctly, if they were all regression datatypes it worked fine, I believe for categorical too, but when you mix and match things you get into trouble.
(For the record thatās a bug, and should/will be looked at eventually)
For anyone interested, as Muellerzr suggested I simply passed a list of colums to dependent variables.
dep_vars = āvar1ā, āvar2ā, āvarā
Then switched dep_var for dep_vars in other places in the code.
Notebook from fastai-> fastbook -> 09_tabular
That tabular notebook seems compatible with a very limited information data set such as 10-20 rows.
First though, āNo! It canāt be. Itās too simple.ā Anyway, I still have a lot of work to do. But for now, very grateful.
Can someone point to an example of working code?