{"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":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-06-04T20:56:47.726623Z","iopub.execute_input":"2022-06-04T20:56:47.727468Z","iopub.status.idle":"2022-06-04T20:56:47.755802Z","shell.execute_reply.started":"2022-06-04T20:56:47.727362Z","shell.execute_reply":"2022-06-04T20:56:47.755055Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Last Presentation of Rethabile, Calson, Princess and Thubisi","metadata":{}},{"cell_type":"markdown","source":"We load in the Nvidia command sice we want to use the rapids enviroment for faster results","metadata":{}},{"cell_type":"code","source":"!nvidia-smi","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:38:12.242598Z","iopub.execute_input":"2022-06-05T13:38:12.242948Z","iopub.status.idle":"2022-06-05T13:38:12.953995Z","shell.execute_reply.started":"2022-06-05T13:38:12.242919Z","shell.execute_reply":"2022-06-05T13:38:12.953069Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!nvcc --version","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:38:19.102681Z","iopub.execute_input":"2022-06-05T13:38:19.103349Z","iopub.status.idle":"2022-06-05T13:38:19.833996Z","shell.execute_reply.started":"2022-06-05T13:38:19.103298Z","shell.execute_reply":"2022-06-05T13:38:19.832979Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Libraries for final Presentation","metadata":{}},{"cell_type":"code","source":"import cudf, gc\nimport cv2, matplotlib.pyplot as plt\nfrom os.path import exists\nprint('RAPIDS version',cudf.__version__)\nimport numpy as np \nimport pandas as pd \nimport plotly.graph_objects as go\nfrom skimage import io\n\n","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:38:25.068875Z","iopub.execute_input":"2022-06-05T13:38:25.069709Z","iopub.status.idle":"2022-06-05T13:38:25.075506Z","shell.execute_reply.started":"2022-06-05T13:38:25.069668Z","shell.execute_reply":"2022-06-05T13:38:25.074709Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Loading the data","metadata":{}},{"cell_type":"markdown","source":"In this part we also do some feature engineering and create a subset of only the colums we will use from the data.","metadata":{}},{"cell_type":"code","source":"df = pd.read_csv('../input/h-and-m-personalized-fashion-recommendations/transactions_train.csv', chunksize=100000)\narticles = pd.read_csv('../input/h-and-m-personalized-fashion-recommendations/articles.csv')\nusers = next(df)\ndf = users.merge(articles, on='article_id')\ndf = df[['t_dat', 'customer_id', 'article_id', 'prod_name', 'product_type_name',\n       'product_group_name', \n       'graphical_appearance_name', 'colour_group_name',\n       'perceived_colour_value_name',\n       'perceived_colour_master_name',\n       'department_name', 'index_name',\n       'index_group_name', 'section_name',\n       'garment_group_name', 'detail_desc']]\n\nfeature_subset = ['product_group_name', \n       'graphical_appearance_name', 'colour_group_name',\n       'perceived_colour_value_name',\n       'perceived_colour_master_name',\n       'department_name', 'index_name',\n       'index_group_name', 'section_name',\n       'garment_group_name']","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:38:32.968388Z","iopub.execute_input":"2022-06-05T13:38:32.968737Z","iopub.status.idle":"2022-06-05T13:38:34.758516Z","shell.execute_reply.started":"2022-06-05T13:38:32.968708Z","shell.execute_reply":"2022-06-05T13:38:34.757591Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.shape","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:38:43.181241Z","iopub.execute_input":"2022-06-05T13:38:43.181825Z","iopub.status.idle":"2022-06-05T13:38:43.189421Z","shell.execute_reply.started":"2022-06-05T13:38:43.181788Z","shell.execute_reply":"2022-06-05T13:38:43.1887Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df.head()","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:38:46.351478Z","iopub.execute_input":"2022-06-05T13:38:46.352188Z","iopub.status.idle":"2022-06-05T13:38:46.374982Z","shell.execute_reply.started":"2022-06-05T13:38:46.352153Z","shell.execute_reply":"2022-06-05T13:38:46.37428Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Choose features to build feature space\nfeatures = feature_subset\ndf1 = df[['customer_id', 'article_id'] + features]\ndummies_df = pd.get_dummies(df1, columns=features)\ndummies_df","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:38:50.922355Z","iopub.execute_input":"2022-06-05T13:38:50.923209Z","iopub.status.idle":"2022-06-05T13:38:51.285469Z","shell.execute_reply.started":"2022-06-05T13:38:50.923164Z","shell.execute_reply":"2022-06-05T13:38:51.284547Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"On the next cell we actually want to see whch items are frequently bought together from the dataset to help us make better reccomendations.","metadata":{}},{"cell_type":"code","source":"minimum_items = 2\ngroupby_customer = dummies_df.groupby('customer_id')\n\nl = []\ncutomer_ids = []\narticle_ids = []\nfor key in groupby_customer.groups.keys():\n    temp = groupby_customer.get_group(key)\n    if temp.article_id.nunique() >= minimum_items:\n        l.append(temp.drop('article_id', axis=1).sum(numeric_only=True).values)\n        cutomer_ids.append(key)\n        article_ids.extend(temp.article_id.values.tolist())","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:39:49.86455Z","iopub.execute_input":"2022-06-05T13:39:49.865449Z","iopub.status.idle":"2022-06-05T13:40:37.53043Z","shell.execute_reply.started":"2022-06-05T13:39:49.865396Z","shell.execute_reply":"2022-06-05T13:40:37.529643Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"user_feature = pd.DataFrame(l, columns = dummies_df.columns[2:])\nnormalized_user_feature = user_feature.div(user_feature.sum(axis=1), axis=0)\nnormalized_user_feature.insert(0, 'customer_id', cutomer_ids)\nnormalized_user_feature = normalized_user_feature.set_index('customer_id')\nnormalized_user_feature","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:45:56.624713Z","iopub.execute_input":"2022-06-05T13:45:56.625251Z","iopub.status.idle":"2022-06-05T13:46:02.279296Z","shell.execute_reply.started":"2022-06-05T13:45:56.625205Z","shell.execute_reply":"2022-06-05T13:46:02.278559Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"item_feature = dummies_df.drop_duplicates(subset='article_id')\nitem_feature = item_feature[item_feature.article_id.isin(article_ids)].drop('customer_id', axis=1)\nitem_feature = item_feature.set_index('article_id')\nitem_feature","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:46:10.816878Z","iopub.execute_input":"2022-06-05T13:46:10.817832Z","iopub.status.idle":"2022-06-05T13:46:10.951181Z","shell.execute_reply.started":"2022-06-05T13:46:10.817771Z","shell.execute_reply":"2022-06-05T13:46:10.950433Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scores = normalized_user_feature.dot(item_feature.T)\nscores","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:46:17.672289Z","iopub.execute_input":"2022-06-05T13:46:17.672636Z","iopub.status.idle":"2022-06-05T13:46:21.682084Z","shell.execute_reply.started":"2022-06-05T13:46:17.672608Z","shell.execute_reply":"2022-06-05T13:46:21.681332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Creating our recomendations system","metadata":{}},{"cell_type":"markdown","source":"The recomendations systems works by taking the article_ids which represent the products and analyses how each respective customer bought items by looking at atleast two items bought.","metadata":{}},{"cell_type":"code","source":"def get_rcmnd(customer_id, scores):\n    cutomer_scores = scores.loc[customer_id]\n    customer_prev_items = groupby_customer.get_group(customer_id)['article_id']\n    prev_dropped = cutomer_scores.drop(customer_prev_items.values)\n    ordered = prev_dropped.sort_values(ascending=False)   \n    return ordered, customer_prev_items","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:46:28.829278Z","iopub.execute_input":"2022-06-05T13:46:28.829628Z","iopub.status.idle":"2022-06-05T13:46:28.834913Z","shell.execute_reply.started":"2022-06-05T13:46:28.829599Z","shell.execute_reply":"2022-06-05T13:46:28.833797Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_prev(prev_items):\n    fig = plt.figure(figsize=(20, 10))\n    for item, i in zip(prev_items, range(1, len(prev_items)+1)):\n        item = '0' + str(item)\n        sub = item[:3]\n        image = path + \"/\"+ sub + \"/\"+ item +\".jpg\"\n        image = plt.imread(image)\n        fig.add_subplot(1, 6, i)\n        plt.imshow(image)","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:46:37.47773Z","iopub.execute_input":"2022-06-05T13:46:37.478101Z","iopub.status.idle":"2022-06-05T13:46:37.484509Z","shell.execute_reply.started":"2022-06-05T13:46:37.478072Z","shell.execute_reply":"2022-06-05T13:46:37.483432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def plot_rcmnd(rcmnds):\n    fig = plt.figure(figsize=(20, 10))\n    for item, i in zip(rcmnds, range(1, k+1)):\n        item = '0' + str(item)\n        sub = item[:3]\n        image = path + \"/\"+ sub + \"/\"+ item +\".jpg\"\n        image = plt.imread(image)\n        fig.add_subplot(1, 6, i)\n        plt.imshow(image)","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:46:40.481426Z","iopub.execute_input":"2022-06-05T13:46:40.482306Z","iopub.status.idle":"2022-06-05T13:46:40.489837Z","shell.execute_reply.started":"2022-06-05T13:46:40.482273Z","shell.execute_reply":"2022-06-05T13:46:40.488194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We then use a PCA libray to help us decompose the multivariate dataset in a set of orthogonal components that explain the maximum amount of the variance.","metadata":{}},{"cell_type":"code","source":"from sklearn.decomposition import PCA","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:46:50.658779Z","iopub.execute_input":"2022-06-05T13:46:50.659434Z","iopub.status.idle":"2022-06-05T13:46:50.663493Z","shell.execute_reply.started":"2022-06-05T13:46:50.659395Z","shell.execute_reply":"2022-06-05T13:46:50.662352Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pca = PCA(n_components=100)\npca.fit(normalized_user_feature)\npca.explained_variance_ratio_.sum()","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:59:15.387371Z","iopub.execute_input":"2022-06-05T13:59:15.38776Z","iopub.status.idle":"2022-06-05T13:59:17.083175Z","shell.execute_reply.started":"2022-06-05T13:59:15.387729Z","shell.execute_reply":"2022-06-05T13:59:17.082254Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"user_feature_pca = pd.DataFrame(pca.transform(normalized_user_feature), columns=['component_{}'.format(i) for i in range(1, 101)]).set_index(normalized_user_feature.index)\nitem_feature_pca = pd.DataFrame(pca.transform(item_feature), columns=['component_{}'.format(i) for i in range(1, 101)]).set_index(item_feature.index)","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:59:26.775695Z","iopub.execute_input":"2022-06-05T13:59:26.776066Z","iopub.status.idle":"2022-06-05T13:59:26.994221Z","shell.execute_reply.started":"2022-06-05T13:59:26.77603Z","shell.execute_reply":"2022-06-05T13:59:26.993262Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scores_pca = user_feature_pca.dot(item_feature_pca.T)","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:59:29.933741Z","iopub.execute_input":"2022-06-05T13:59:29.934116Z","iopub.status.idle":"2022-06-05T13:59:31.443117Z","shell.execute_reply.started":"2022-06-05T13:59:29.934084Z","shell.execute_reply":"2022-06-05T13:59:31.442093Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"Changing the index number changes the recommendations that are given by our system.","metadata":{}},{"cell_type":"code","source":"k = 6\ncustomer_id = scores.index[1]\nrcmnds, prev_items = get_rcmnd(customer_id, scores)\nrcmnds_pca, prev_items = get_rcmnd(customer_id, scores_pca)\nrcmnds = rcmnds.index.values[:k]\nrcmnds_pca = rcmnds_pca.index.values[:k]\npath = \"../input/h-and-m-personalized-fashion-recommendations/images\"","metadata":{"execution":{"iopub.status.busy":"2022-06-05T14:13:13.461045Z","iopub.execute_input":"2022-06-05T14:13:13.461733Z","iopub.status.idle":"2022-06-05T14:13:13.475273Z","shell.execute_reply.started":"2022-06-05T14:13:13.461695Z","shell.execute_reply":"2022-06-05T14:13:13.474524Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The first output gives us two pictures the one on the left is th picture that is bought and the one on the right is the picture that customers most likely buy too based on the data.","metadata":{}},{"cell_type":"code","source":"plot_prev(prev_items)\n","metadata":{"execution":{"iopub.status.busy":"2022-06-05T14:13:21.056516Z","iopub.execute_input":"2022-06-05T14:13:21.056862Z","iopub.status.idle":"2022-06-05T14:13:21.792305Z","shell.execute_reply.started":"2022-06-05T14:13:21.056835Z","shell.execute_reply":"2022-06-05T14:13:21.791569Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The next function recommends items based on simmilar items that where bought(similar in respect to the type of item that was bought).","metadata":{}},{"cell_type":"code","source":"plot_rcmnd(rcmnds)","metadata":{"execution":{"iopub.status.busy":"2022-06-05T14:28:15.509946Z","iopub.execute_input":"2022-06-05T14:28:15.510591Z","iopub.status.idle":"2022-06-05T14:28:17.7459Z","shell.execute_reply.started":"2022-06-05T14:28:15.510555Z","shell.execute_reply":"2022-06-05T14:28:17.745051Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"The next line of code is then our final refined model that compares the items that are bought together in respect to other items e.g we also have panties to look at when buying bras which in real life would be a good reccomendation.","metadata":{}},{"cell_type":"code","source":"plot_rcmnd(rcmnds_pca)","metadata":{"execution":{"iopub.status.busy":"2022-06-05T14:28:30.584114Z","iopub.execute_input":"2022-06-05T14:28:30.584481Z","iopub.status.idle":"2022-06-05T14:28:32.825613Z","shell.execute_reply.started":"2022-06-05T14:28:30.584437Z","shell.execute_reply":"2022-06-05T14:28:32.824901Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# LOAD TRANSACTIONS DATAFRAME\ndf = cudf.read_csv('../input/h-and-m-personalized-fashion-recommendations/transactions_train.csv')\nprint('Transactions shape',df.shape)\ndisplay( df.head() )\n\n# REDUCE MEMORY OF DATAFRAME\ndf = df[['customer_id','article_id']]\ndf.customer_id = df.customer_id.str[-16:].str.hex_to_int().astype('int64')\ndf.article_id = df.article_id.astype('int32')\n_ = gc.collect()","metadata":{"execution":{"iopub.status.busy":"2022-06-05T14:31:51.251111Z","iopub.execute_input":"2022-06-05T14:31:51.251553Z","iopub.status.idle":"2022-06-05T14:32:32.849865Z","shell.execute_reply.started":"2022-06-05T14:31:51.251513Z","shell.execute_reply":"2022-06-05T14:32:32.849063Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# FIND ITEMS PURCHASED TOGETHER\nvc = df.article_id.value_counts()\npairs = {}\nfor j,i in enumerate(vc.index.values[1000:1032]):\n    #if j%10==0: print(j,', ',end='')\n    USERS = df.loc[df.article_id==i.item(),'customer_id'].unique()\n    vc2 = df.loc[(df.customer_id.isin(USERS))&(df.article_id!=i.item()),'article_id'].value_counts()\n    pairs[i.item()] = [vc2.index[0], vc2.index[1], vc2.index[2]]","metadata":{"execution":{"iopub.status.busy":"2022-06-05T10:50:17.424365Z","iopub.execute_input":"2022-06-05T10:50:17.425002Z","iopub.status.idle":"2022-06-05T10:50:25.549667Z","shell.execute_reply.started":"2022-06-05T10:50:17.42496Z","shell.execute_reply":"2022-06-05T10:50:25.548874Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## When Customers buy the product in the first column they are likely to buy the item in the 2nd, 3rd and 4th colum too.","metadata":{}},{"cell_type":"code","source":"items = cudf.read_csv('../input/h-and-m-personalized-fashion-recommendations/articles.csv')\nBASE = '../input/h-and-m-personalized-fashion-recommendations/images/'\n\nfor i,(k,v) in enumerate( pairs.items() ):\n    name1 = BASE+'0'+str(k)[:2]+'/0'+str(k)+'.jpg'\n    name2 = BASE+'0'+str(v[0])[:2]+'/0'+str(v[0])+'.jpg'\n    name3 = BASE+'0'+str(v[1])[:2]+'/0'+str(v[1])+'.jpg'\n    name4 = BASE+'0'+str(v[2])[:2]+'/0'+str(v[2])+'.jpg'\n    if exists(name1) & exists(name2) & exists(name3) & exists(name4):\n        plt.figure(figsize=(20,5))\n        img1 = cv2.imread(name1)[:,:,::-1]\n        img2 = cv2.imread(name2)[:,:,::-1]\n        img3 = cv2.imread(name3)[:,:,::-1]\n        img4 = cv2.imread(name4)[:,:,::-1]\n        plt.subplot(1,4,1)\n        plt.title('When customers buy this',size=18)\n        plt.imshow(img1)\n        plt.subplot(1,4,2)\n        plt.title('They most likely buy this too',size=18)\n        plt.imshow(img2)\n        plt.subplot(1,4,3)\n        plt.title('They also consider buying this',size=18)\n        plt.imshow(img3)\n        plt.subplot(1,4,4)\n        plt.title('Theybuying this',size=18)\n        plt.imshow(img4)\n        plt.show()\n    ","metadata":{"execution":{"iopub.status.busy":"2022-06-05T10:51:12.723742Z","iopub.execute_input":"2022-06-05T10:51:12.724273Z","iopub.status.idle":"2022-06-05T10:51:51.99148Z","shell.execute_reply.started":"2022-06-05T10:51:12.724233Z","shell.execute_reply":"2022-06-05T10:51:51.990486Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## The WorkFlow of the Application","metadata":{}},{"cell_type":"markdown","source":"## Login Details ","metadata":{}},{"cell_type":"code","source":"name=input(\"Please input your name or customer id\")\n#Default pin\npin=14140\nfor i in range(3):\n    pincode=int(input(\"Please enter your Pincode:\"))\n    if (pincode==pin):\n        print(\"Welcome \"+name)\n        break\n    else:\n        print(\"Inncoreect password please re-enter the password\")","metadata":{"execution":{"iopub.status.busy":"2022-06-05T11:39:51.685785Z","iopub.execute_input":"2022-06-05T11:39:51.686557Z","iopub.status.idle":"2022-06-05T11:40:12.884159Z","shell.execute_reply.started":"2022-06-05T11:39:51.686522Z","shell.execute_reply":"2022-06-05T11:40:12.883332Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Second part of workflow","metadata":{}},{"cell_type":"code","source":"#Here we want to give recommendations to the customer based on the recommendations model we have \n#created that looks at the trends of the items that are bougt together in the data set.","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"items = cudf.read_csv('../input/h-and-m-personalized-fashion-recommendations/articles.csv')\nBASE = '../input/h-and-m-personalized-fashion-recommendations/images/'\n\nfor i,(k,v) in enumerate( pairs.items() ):\n    name1 = BASE+'0'+str(k)[:2]+'/0'+str(k)+'.jpg'\n    name2 = BASE+'0'+str(v[0])[:2]+'/0'+str(v[0])+'.jpg'\n    name3 = BASE+'0'+str(v[1])[:2]+'/0'+str(v[1])+'.jpg'\n    name4 = BASE+'0'+str(v[2])[:2]+'/0'+str(v[2])+'.jpg'\n    if exists(name1) & exists(name2) & exists(name3) & exists(name4):\n        plt.figure(figsize=(20,5))\n        img1 = cv2.imread(name1)[:,:,::-1]\n        img2 = cv2.imread(name2)[:,:,::-1]\n        img3 = cv2.imread(name3)[:,:,::-1]\n        img4 = cv2.imread(name4)[:,:,::-1]\n        plt.subplot(1,4,1)\n        plt.title('When customers buy this',size=18)\n        plt.imshow(img1)\n        plt.subplot(1,4,2)\n        plt.title('They most likely buy this too',size=18)\n        plt.imshow(img2)\n        plt.subplot(1,4,3)\n        plt.title('They also consider buying this',size=18)\n        plt.imshow(img3)\n        plt.subplot(1,4,4)\n        plt.title('Theybuying this',size=18)\n        plt.imshow(img4)\n        plt.show()\n    ","metadata":{"execution":{"iopub.status.busy":"2022-06-05T12:15:08.884179Z","iopub.execute_input":"2022-06-05T12:15:08.884535Z","iopub.status.idle":"2022-06-05T12:15:48.407453Z","shell.execute_reply.started":"2022-06-05T12:15:08.884506Z","shell.execute_reply":"2022-06-05T12:15:48.406715Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Third part of WorkFlow","metadata":{}},{"cell_type":"markdown","source":"# Here we simply want to gather more information about the user so that we can send them more personalised advertisemts.","metadata":{}},{"cell_type":"code","source":"print(\"Kindly click the following link for us to know you better https://forms.gle/Yj61mfS5C3CTHrp6A \")","metadata":{"execution":{"iopub.status.busy":"2022-06-05T13:14:45.724248Z","iopub.execute_input":"2022-06-05T13:14:45.724766Z","iopub.status.idle":"2022-06-05T13:14:45.750928Z","shell.execute_reply.started":"2022-06-05T13:14:45.724662Z","shell.execute_reply":"2022-06-05T13:14:45.750003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}}]}