Hi Ilya,
First, thanks so much for putting together this really helpful repo!
I've been trying to understand channel-attribution-lstm, and I've got a couple of questions about your features_for_lstm function.
- This code here:
f_proj = df[['jid', 'campaigns', 'cats', 'click', 'cost', 'time_since_last_click_norm', \ 'timestamp_norm', 'conversion']]
x2d = df_proj.values
x3d_list = np.split(x2d[:, 1:], np.cumsum(np.unique(x2d[:, 0], return_counts=True)[1])[:-1])
Won't this split only work as intended if f_proj is sorted out by jid first? If the goal here is to separate out the sub-arrays for individual jids? Or am I missing the point?
journey_matrix = journey_matrix[ journey_matrix[:, 5].argsort() ] # sort impressions by timestamp
Why 5 here? The timestamp_norm field is next to last in the journey_matrix array, so shouldn't it be journey_matrix.shape[1]-2?
-
Finally, I had to convert y_train, y_val, and y_test into arrays for the model to run; it wouln't work for me as written because they were lists.
I'd really appreciate your help! Thank you again --
Natalia
Hi Ilya,
First, thanks so much for putting together this really helpful repo!
I've been trying to understand channel-attribution-lstm, and I've got a couple of questions about your features_for_lstm function.
f_proj = df[['jid', 'campaigns', 'cats', 'click', 'cost', 'time_since_last_click_norm', \ 'timestamp_norm', 'conversion']]x2d = df_proj.valuesx3d_list = np.split(x2d[:, 1:], np.cumsum(np.unique(x2d[:, 0], return_counts=True)[1])[:-1])Won't this split only work as intended if
f_projis sorted out byjidfirst? If the goal here is to separate out the sub-arrays for individualjids? Or am I missing the point?journey_matrix = journey_matrix[ journey_matrix[:, 5].argsort() ] # sort impressions by timestampWhy 5 here? The
timestamp_normfield is next to last in thejourney_matrixarray, so shouldn't it bejourney_matrix.shape[1]-2?Finally, I had to convert
y_train,y_val, andy_testinto arrays for the model to run; it wouln't work for me as written because they were lists.I'd really appreciate your help! Thank you again --
Natalia