{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\nfrom scipy.stats import pearsonr, linregress, normaltest, boxcox, norm\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom math import exp\n\nfrom scipy.optimize import curve_fit\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\nfrom pathlib import Path\n\ndata_path = Path('/kaggle/input/otto-recommender-system/')","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-12-22T13:59:10.132944Z","iopub.execute_input":"2022-12-22T13:59:10.133366Z","iopub.status.idle":"2022-12-22T13:59:10.811152Z","shell.execute_reply.started":"2022-12-22T13:59:10.133332Z","shell.execute_reply":"2022-12-22T13:59:10.809919Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Put all labels in tha same lenght (20)","metadata":{}},{"cell_type":"code","source":"%%time\n\ntrain_sessions = pd.DataFrame()\nchunks = pd.read_json(data_path / 'train.jsonl', lines=True, chunksize=100_000)\n\nfor e, chunk in enumerate(chunks):\n    event_dict = {\n        'session': [],\n        'aid': [],\n        'ts': [],\n        'type': [],\n    }\n    if e < 2:\n        # train_sessions = pd.concat([train_sessions, chunk])\n        for session, events in zip(chunk['session'].tolist(), chunk['events'].tolist()):\n            for event in events:\n                event_dict['session'].append(session)\n                event_dict['aid'].append(event['aid'])\n                event_dict['ts'].append(event['ts'])\n                event_dict['type'].append(event['type'])\n        chunk_session = pd.DataFrame(event_dict)\n        train_sessions = pd.concat([train_sessions, chunk_session])\n    else:\n        break\n        \ntrain_sessions = train_sessions.reset_index(drop=True)","metadata":{"execution":{"iopub.status.busy":"2022-12-22T13:59:10.812779Z","iopub.execute_input":"2022-12-22T13:59:10.813635Z","iopub.status.idle":"2022-12-22T14:00:06.885372Z","shell.execute_reply.started":"2022-12-22T13:59:10.813599Z","shell.execute_reply":"2022-12-22T14:00:06.884144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_sessions","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:06.886851Z","iopub.execute_input":"2022-12-22T14:00:06.887214Z","iopub.status.idle":"2022-12-22T14:00:06.909958Z","shell.execute_reply.started":"2022-12-22T14:00:06.887180Z","shell.execute_reply":"2022-12-22T14:00:06.908633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(set(train_sessions['aid']))","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:06.912572Z","iopub.execute_input":"2022-12-22T14:00:06.912980Z","iopub.status.idle":"2022-12-22T14:00:09.732366Z","shell.execute_reply.started":"2022-12-22T14:00:06.912944Z","shell.execute_reply":"2022-12-22T14:00:09.730788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#### There is 951294 unique articles","metadata":{}},{"cell_type":"code","source":"aid_id = list(set(train_sessions['aid']))","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:09.734206Z","iopub.execute_input":"2022-12-22T14:00:09.734779Z","iopub.status.idle":"2022-12-22T14:00:12.721994Z","shell.execute_reply.started":"2022-12-22T14:00:09.734724Z","shell.execute_reply":"2022-12-22T14:00:12.720491Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"aid_int = [i for i in range(1, 951295)]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:12.723289Z","iopub.execute_input":"2022-12-22T14:00:12.723662Z","iopub.status.idle":"2022-12-22T14:00:12.796931Z","shell.execute_reply.started":"2022-12-22T14:00:12.723629Z","shell.execute_reply":"2022-12-22T14:00:12.795259Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"aid_int[951293]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:12.798641Z","iopub.execute_input":"2022-12-22T14:00:12.799324Z","iopub.status.idle":"2022-12-22T14:00:12.807145Z","shell.execute_reply.started":"2022-12-22T14:00:12.799154Z","shell.execute_reply":"2022-12-22T14:00:12.805990Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# We create the dictionary {aid : integer}\ndict_aid_int = {aid : integer for (aid, integer) in zip(aid_id, aid_int)}","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:12.809022Z","iopub.execute_input":"2022-12-22T14:00:12.809777Z","iopub.status.idle":"2022-12-22T14:00:13.181353Z","shell.execute_reply.started":"2022-12-22T14:00:12.809725Z","shell.execute_reply":"2022-12-22T14:00:13.179864Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# And we create the dictionary {integer : aid}\ndict_int_aid = {integer : aid for (aid, integer) in zip(aid_id, aid_int)}","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:13.182862Z","iopub.execute_input":"2022-12-22T14:00:13.183232Z","iopub.status.idle":"2022-12-22T14:00:13.455839Z","shell.execute_reply.started":"2022-12-22T14:00:13.183199Z","shell.execute_reply":"2022-12-22T14:00:13.454464Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\ntrain_sessions_clicks = train_sessions[train_sessions['type'] == 'clicks']\ntrain_sessions_carts = train_sessions[train_sessions['type'] == 'carts']\ntrain_sessions_orders = train_sessions[train_sessions['type'] == 'orders']\n\nfor df in [train_sessions_clicks, train_sessions_carts, train_sessions_orders]:\n    df.reset_index(drop = True, inplace = True)","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:13.521772Z","iopub.execute_input":"2022-12-22T14:00:13.522743Z","iopub.status.idle":"2022-12-22T14:00:17.020350Z","shell.execute_reply.started":"2022-12-22T14:00:13.522692Z","shell.execute_reply":"2022-12-22T14:00:17.019261Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\ntrain_sessions_clicks['aid_int'] = [dict_aid_int[x] for x in train_sessions_clicks['aid']]\ntrain_sessions_carts['aid_int'] = [dict_aid_int[x] for x in train_sessions_carts['aid']]\ntrain_sessions_orders['aid_int'] = [dict_aid_int[x] for x in train_sessions_orders['aid']]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:17.022210Z","iopub.execute_input":"2022-12-22T14:00:17.022678Z","iopub.status.idle":"2022-12-22T14:00:27.689207Z","shell.execute_reply.started":"2022-12-22T14:00:17.022636Z","shell.execute_reply":"2022-12-22T14:00:27.687961Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.hist(train_sessions_clicks['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:27.691056Z","iopub.execute_input":"2022-12-22T14:00:27.692208Z","iopub.status.idle":"2022-12-22T14:00:28.141230Z","shell.execute_reply.started":"2022-12-22T14:00:27.692144Z","shell.execute_reply":"2022-12-22T14:00:28.140002Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"normaltest(train_sessions_clicks['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:28.142880Z","iopub.execute_input":"2022-12-22T14:00:28.144550Z","iopub.status.idle":"2022-12-22T14:00:28.543695Z","shell.execute_reply.started":"2022-12-22T14:00:28.144375Z","shell.execute_reply":"2022-12-22T14:00:28.542504Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"box_cox = boxcox(train_sessions_clicks['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:28.545055Z","iopub.execute_input":"2022-12-22T14:00:28.545506Z","iopub.status.idle":"2022-12-22T14:00:38.572184Z","shell.execute_reply.started":"2022-12-22T14:00:28.545471Z","shell.execute_reply":"2022-12-22T14:00:38.570906Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.hist(box_cox[0])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:38.573672Z","iopub.execute_input":"2022-12-22T14:00:38.574043Z","iopub.status.idle":"2022-12-22T14:00:38.921128Z","shell.execute_reply.started":"2022-12-22T14:00:38.574009Z","shell.execute_reply":"2022-12-22T14:00:38.919948Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"normaltest(box_cox[0])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:38.922796Z","iopub.execute_input":"2022-12-22T14:00:38.923275Z","iopub.status.idle":"2022-12-22T14:00:39.276569Z","shell.execute_reply.started":"2022-12-22T14:00:38.923223Z","shell.execute_reply":"2022-12-22T14:00:39.275170Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lambda_clicks = box_cox[1]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.277993Z","iopub.execute_input":"2022-12-22T14:00:39.280612Z","iopub.status.idle":"2022-12-22T14:00:39.286865Z","shell.execute_reply.started":"2022-12-22T14:00:39.280565Z","shell.execute_reply":"2022-12-22T14:00:39.285342Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"m_clicks = np.mean(box_cox[0])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.288436Z","iopub.execute_input":"2022-12-22T14:00:39.288816Z","iopub.status.idle":"2022-12-22T14:00:39.305939Z","shell.execute_reply.started":"2022-12-22T14:00:39.288782Z","shell.execute_reply":"2022-12-22T14:00:39.304569Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s_clicks = np.std(box_cox[0])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.307680Z","iopub.execute_input":"2022-12-22T14:00:39.308079Z","iopub.status.idle":"2022-12-22T14:00:39.359101Z","shell.execute_reply.started":"2022-12-22T14:00:39.308044Z","shell.execute_reply":"2022-12-22T14:00:39.357961Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"m_clicks","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.360893Z","iopub.execute_input":"2022-12-22T14:00:39.361285Z","iopub.status.idle":"2022-12-22T14:00:39.370196Z","shell.execute_reply.started":"2022-12-22T14:00:39.361248Z","shell.execute_reply":"2022-12-22T14:00:39.368944Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"s_clicks","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.371866Z","iopub.execute_input":"2022-12-22T14:00:39.372976Z","iopub.status.idle":"2022-12-22T14:00:39.382470Z","shell.execute_reply.started":"2022-12-22T14:00:39.372935Z","shell.execute_reply":"2022-12-22T14:00:39.381249Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.min(train_sessions_clicks['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.384110Z","iopub.execute_input":"2022-12-22T14:00:39.384466Z","iopub.status.idle":"2022-12-22T14:00:39.404195Z","shell.execute_reply.started":"2022-12-22T14:00:39.384432Z","shell.execute_reply":"2022-12-22T14:00:39.403086Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.max(train_sessions_clicks['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.405797Z","iopub.execute_input":"2022-12-22T14:00:39.406133Z","iopub.status.idle":"2022-12-22T14:00:39.424372Z","shell.execute_reply.started":"2022-12-22T14:00:39.406102Z","shell.execute_reply":"2022-12-22T14:00:39.423444Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.min(train_sessions_carts['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.425562Z","iopub.execute_input":"2022-12-22T14:00:39.426622Z","iopub.status.idle":"2022-12-22T14:00:39.434418Z","shell.execute_reply.started":"2022-12-22T14:00:39.426582Z","shell.execute_reply":"2022-12-22T14:00:39.433405Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.max(train_sessions_carts['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.435585Z","iopub.execute_input":"2022-12-22T14:00:39.436366Z","iopub.status.idle":"2022-12-22T14:00:39.450090Z","shell.execute_reply.started":"2022-12-22T14:00:39.436315Z","shell.execute_reply":"2022-12-22T14:00:39.448463Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.min(train_sessions_orders['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.451974Z","iopub.execute_input":"2022-12-22T14:00:39.453346Z","iopub.status.idle":"2022-12-22T14:00:39.461344Z","shell.execute_reply.started":"2022-12-22T14:00:39.453302Z","shell.execute_reply":"2022-12-22T14:00:39.460123Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"np.max(train_sessions_orders['aid_int'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.463144Z","iopub.execute_input":"2022-12-22T14:00:39.463560Z","iopub.status.idle":"2022-12-22T14:00:39.477513Z","shell.execute_reply.started":"2022-12-22T14:00:39.463524Z","shell.execute_reply":"2022-12-22T14:00:39.476079Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_sample = pd.read_csv('/kaggle/input/otto-recommender-system/sample_submission.csv')","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:39.484848Z","iopub.execute_input":"2022-12-22T14:00:39.485286Z","iopub.status.idle":"2022-12-22T14:00:46.198765Z","shell.execute_reply.started":"2022-12-22T14:00:39.485251Z","shell.execute_reply":"2022-12-22T14:00:46.197474Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_sample","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:46.200509Z","iopub.execute_input":"2022-12-22T14:00:46.201000Z","iopub.status.idle":"2022-12-22T14:00:46.216346Z","shell.execute_reply.started":"2022-12-22T14:00:46.200943Z","shell.execute_reply":"2022-12-22T14:00:46.214888Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_sample['lab'] = [np.random.randint(1, 951294, size=20) for i in range(len(sub_sample))]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:00:46.217983Z","iopub.execute_input":"2022-12-22T14:00:46.218465Z","iopub.status.idle":"2022-12-22T14:01:52.070267Z","shell.execute_reply.started":"2022-12-22T14:00:46.218386Z","shell.execute_reply":"2022-12-22T14:01:52.068965Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_sample","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:01:52.071856Z","iopub.execute_input":"2022-12-22T14:01:52.072371Z","iopub.status.idle":"2022-12-22T14:01:52.092965Z","shell.execute_reply.started":"2022-12-22T14:01:52.072331Z","shell.execute_reply":"2022-12-22T14:01:52.091546Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_sample['lab_2']=[[dict_int_aid[x] for x in y] for y in sub_sample['lab']]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:01:52.094521Z","iopub.execute_input":"2022-12-22T14:01:52.094946Z","iopub.status.idle":"2022-12-22T14:03:09.491379Z","shell.execute_reply.started":"2022-12-22T14:01:52.094907Z","shell.execute_reply":"2022-12-22T14:03:09.489829Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_sample['lab_3']=[[str(x) for x in y] for y in sub_sample['lab_2']]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:03:09.492894Z","iopub.execute_input":"2022-12-22T14:03:09.493300Z","iopub.status.idle":"2022-12-22T14:03:55.478548Z","shell.execute_reply.started":"2022-12-22T14:03:09.493239Z","shell.execute_reply":"2022-12-22T14:03:55.477547Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub_sample['labels'] = [' '.join(y) for y in sub_sample['lab_3']]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:03:55.480045Z","iopub.execute_input":"2022-12-22T14:03:55.480439Z","iopub.status.idle":"2022-12-22T14:03:58.519199Z","shell.execute_reply.started":"2022-12-22T14:03:55.480384Z","shell.execute_reply":"2022-12-22T14:03:58.517797Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission = sub_sample[['session_type', 'labels']]","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:03:58.520679Z","iopub.execute_input":"2022-12-22T14:03:58.521067Z","iopub.status.idle":"2022-12-22T14:04:00.366901Z","shell.execute_reply.started":"2022-12-22T14:03:58.521031Z","shell.execute_reply":"2022-12-22T14:04:00.365511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:04:00.368363Z","iopub.execute_input":"2022-12-22T14:04:00.368784Z","iopub.status.idle":"2022-12-22T14:04:00.383777Z","shell.execute_reply.started":"2022-12-22T14:04:00.368747Z","shell.execute_reply":"2022-12-22T14:04:00.382370Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission.to_csv('submission.csv', index = False)","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:28.226682Z","iopub.execute_input":"2022-12-22T14:05:28.227104Z","iopub.status.idle":"2022-12-22T14:05:41.926539Z","shell.execute_reply.started":"2022-12-22T14:05:28.227068Z","shell.execute_reply":"2022-12-22T14:05:41.925246Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_sessions_clicks['aid_int']","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:04:00.395319Z","iopub.execute_input":"2022-12-22T14:04:00.395765Z","iopub.status.idle":"2022-12-22T14:04:00.410980Z","shell.execute_reply.started":"2022-12-22T14:04:00.395727Z","shell.execute_reply":"2022-12-22T14:04:00.409522Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def get_sessions_by_aid_number(df):\n    new_df=df\n    new_df['ts_num']=new_df.groupby('session')['ts'].diff().fillna(0)\n    new_df['ts_days']=new_df['ts_num']/86400\n    new_df['ts_days_mean'] = new_df.groupby(['session'])['ts_days'].transform('mean')\n    new_df['aid_N']=new_df.groupby(['session'])['aid'].transform('count')\n    \n    new_df.drop_duplicates('session', inplace=True)\n    \n    new_df=new_df[['session', 'aid_N', 'ts_days_mean']]\n    \n    return new_df","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:04:00.412609Z","iopub.execute_input":"2022-12-22T14:04:00.412977Z","iopub.status.idle":"2022-12-22T14:04:00.422301Z","shell.execute_reply.started":"2022-12-22T14:04:00.412936Z","shell.execute_reply":"2022-12-22T14:04:00.421293Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\ntrain_session_clicks_N = get_sessions_by_aid_number(train_sessions_clicks)\ntrain_session_carts_N = get_sessions_by_aid_number(train_sessions_carts)\ntrain_session_orders_N = get_sessions_by_aid_number(train_sessions_orders)","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:04:00.423256Z","iopub.execute_input":"2022-12-22T14:04:00.423599Z","iopub.status.idle":"2022-12-22T14:05:10.913437Z","shell.execute_reply.started":"2022-12-22T14:04:00.423565Z","shell.execute_reply":"2022-12-22T14:05:10.912272Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_session_clicks_N","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:10.914920Z","iopub.execute_input":"2022-12-22T14:05:10.915254Z","iopub.status.idle":"2022-12-22T14:05:10.930608Z","shell.execute_reply.started":"2022-12-22T14:05:10.915226Z","shell.execute_reply":"2022-12-22T14:05:10.929324Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_session_carts_N","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:10.934196Z","iopub.execute_input":"2022-12-22T14:05:10.935357Z","iopub.status.idle":"2022-12-22T14:05:10.951083Z","shell.execute_reply.started":"2022-12-22T14:05:10.935316Z","shell.execute_reply":"2022-12-22T14:05:10.950006Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_session_orders_N","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:10.952489Z","iopub.execute_input":"2022-12-22T14:05:10.953528Z","iopub.status.idle":"2022-12-22T14:05:10.970701Z","shell.execute_reply.started":"2022-12-22T14:05:10.953479Z","shell.execute_reply":"2022-12-22T14:05:10.969296Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.hist(train_session_clicks_N['aid_N'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:10.972454Z","iopub.execute_input":"2022-12-22T14:05:10.972919Z","iopub.status.idle":"2022-12-22T14:05:11.155447Z","shell.execute_reply.started":"2022-12-22T14:05:10.972873Z","shell.execute_reply":"2022-12-22T14:05:11.154188Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.hist(train_session_carts_N['aid_N'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:11.156947Z","iopub.execute_input":"2022-12-22T14:05:11.157584Z","iopub.status.idle":"2022-12-22T14:05:11.373114Z","shell.execute_reply.started":"2022-12-22T14:05:11.157547Z","shell.execute_reply":"2022-12-22T14:05:11.371838Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.hist(train_session_orders_N['aid_N'])","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:11.374503Z","iopub.execute_input":"2022-12-22T14:05:11.374860Z","iopub.status.idle":"2022-12-22T14:05:11.581750Z","shell.execute_reply.started":"2022-12-22T14:05:11.374824Z","shell.execute_reply":"2022-12-22T14:05:11.580265Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_sessions","metadata":{"execution":{"iopub.status.busy":"2022-12-22T14:05:17.201197Z","iopub.execute_input":"2022-12-22T14:05:17.201620Z","iopub.status.idle":"2022-12-22T14:05:17.217863Z","shell.execute_reply.started":"2022-12-22T14:05:17.201582Z","shell.execute_reply":"2022-12-22T14:05:17.216533Z"},"trusted":true},"execution_count":null,"outputs":[]}]}