{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "314bf34b-1f6d-4a99-8f82-aa71ebacdabc", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import os\n", "import s3fs\n", "import warnings\n", "from datetime import date, timedelta, datetime\n", "import numpy as np\n", "\n", "exec(open('../0_KPI_functions.py').read())" ] }, { "cell_type": "code", "execution_count": 2, "id": "a276822a-c389-429e-b249-8a9e47758bfc", "metadata": {}, "outputs": [], "source": [ "# Ignore warning\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "code", "execution_count": 3, "id": "f62b996c-4e17-40ea-83ba-f0cb60be7671", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['bdc2324-data/1',\n", " 'bdc2324-data/10',\n", " 'bdc2324-data/101',\n", " 'bdc2324-data/11',\n", " 'bdc2324-data/12',\n", " 'bdc2324-data/13',\n", " 'bdc2324-data/14',\n", " 'bdc2324-data/2',\n", " 'bdc2324-data/3',\n", " 'bdc2324-data/4',\n", " 'bdc2324-data/5',\n", " 'bdc2324-data/6',\n", " 'bdc2324-data/7',\n", " 'bdc2324-data/8',\n", " 'bdc2324-data/9']" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Create filesystem object\n", "S3_ENDPOINT_URL = \"https://\" + os.environ[\"AWS_S3_ENDPOINT\"]\n", "fs = s3fs.S3FileSystem(client_kwargs={'endpoint_url': S3_ENDPOINT_URL})\n", "\n", "BUCKET = \"bdc2324-data\"\n", "fs.ls(BUCKET)" ] }, { "cell_type": "markdown", "id": "2c829aa8-2006-4e72-889b-7096dd55718b", "metadata": {}, "source": [ "## Look at the time sequence of each company and compute inter time coverage" ] }, { "cell_type": "code", "execution_count": 73, "id": "e86864b7-4852-449a-8680-638559d56080", "metadata": {}, "outputs": [], "source": [ "sport = ['5', '6', '7', '8', '9']" ] }, { "cell_type": "code", "execution_count": 90, "id": "7634ec57-4891-4684-8638-1e1643baca28", "metadata": {}, "outputs": [], "source": [ "def display_covering_time(df, company, datecover):\n", " \"\"\"\n", " This function draws the time coverage of each company\n", " \"\"\"\n", " min_date = df['purchase_date'].min().strftime(\"%Y-%m-%d\")\n", " max_date = df['purchase_date'].max().strftime(\"%Y-%m-%d\")\n", " datecover[company] = [datetime.strptime(min_date, \"%Y-%m-%d\") + timedelta(days=x) for x in range((datetime.strptime(max_date, \"%Y-%m-%d\") - datetime.strptime(min_date, \"%Y-%m-%d\")).days)]\n", " print(f'Couverture Company {company} : {min_date} - {max_date}')\n", " return datecover" ] }, { "cell_type": "code", "execution_count": 91, "id": "53c83f51-822c-4e05-8c7c-89aa327603c6", "metadata": {}, "outputs": [], "source": [ "def compute_time_intersection(datecover):\n", " timestamps_sets = [set(timestamps) for timestamps in datecover.values()]\n", " intersection = set.intersection(*timestamps_sets)\n", " intersection_list = list(intersection)\n", " formated_dates = [dt.strftime(\"%Y-%m-%d\") for dt in intersection_list]\n", " return sorted(formated_dates)" ] }, { "cell_type": "code", "execution_count": 93, "id": "eec152de-078e-44c4-ad6e-74ae6ba5c65a", "metadata": {}, "outputs": [], "source": [ "def df_coverage_modelization(sport, coverage_train = 0.7):\n", " \"\"\"\n", " This function returns start_date, end_of_features and final dates\n", " that help to construct train and test datasets\n", " \"\"\"\n", " datecover = {}\n", " for company in sport:\n", " df_products_purchased_reduced = display_databases(company, file_name = \"products_purchased_reduced\",\n", " datetime_col = ['purchase_date'])\n", " datecover = display_covering_time(df_products_purchased_reduced, company, datecover)\n", " #print(datecover.keys())\n", " dt_coverage = compute_time_intersection(datecover)\n", " start_date = dt_coverage[0]\n", " end_of_features = dt_coverage[int(0.7 * len(dt_coverage))]\n", " final_date = dt_coverage[-1]\n", " return start_date, end_of_features, final_date\n", " " ] }, { "cell_type": "code", "execution_count": 94, "id": "348f246a-bc2d-4bbc-ba05-aa825da15a69", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "File path : projet-bdc2324-team1/0_Input/Company_5/products_purchased_reduced.csv\n", "Couverture Company 5 : 2019-04-15 - 2023-11-09\n", "File path : projet-bdc2324-team1/0_Input/Company_6/products_purchased_reduced.csv\n", "Couverture Company 6 : 2018-06-28 - 2023-11-08\n", "File path : projet-bdc2324-team1/0_Input/Company_7/products_purchased_reduced.csv\n", "Couverture Company 7 : 2015-02-10 - 2023-11-08\n", "File path : projet-bdc2324-team1/0_Input/Company_8/products_purchased_reduced.csv\n", "Couverture Company 8 : 2010-09-28 - 2023-11-08\n", "File path : projet-bdc2324-team1/0_Input/Company_9/products_purchased_reduced.csv\n", "Couverture Company 9 : 2014-09-22 - 2023-10-24\n", "dict_keys(['5', '6', '7', '8', '9'])\n", "2019-04-15 2022-06-15 2023-10-23\n" ] } ], "source": [ "start_date, end_of_features, final_date = df_coverage_modelization(sport, coverage_train = 0.7)\n", "print(start_date, end_of_features, final_date )" ] }, { "cell_type": "markdown", "id": "34ddc267-4daa-4926-9d54-5b13d4212eaa", "metadata": {}, "source": [ "## Look at common database between Sport companies" ] }, { "cell_type": "code", "execution_count": 101, "id": "389387fa-2046-4811-b8dd-6d524e91fe2e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['bdc2324-data/5',\n", " 'bdc2324-data/6',\n", " 'bdc2324-data/7',\n", " 'bdc2324-data/8',\n", " 'bdc2324-data/9']" ] }, "execution_count": 101, "metadata": {}, "output_type": "execute_result" } ], "source": [ "companies = fs.ls(BUCKET)\n", "companies = [company for company in companies if any(company.endswith(end) for end in sport)]\n", "companies" ] }, { "cell_type": "code", "execution_count": 107, "id": "895fc2b3-c768-454d-bedb-54994e4d211a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Number of databases : 30\n", "Number of common databases : 23\n" ] } ], "source": [ "companies_database = {}\n", "\n", "for company in companies:\n", " companies_database[company.split('/')[-1]] = [file.split('/')[-1].replace(company.split('/')[-1], '') for file in fs.ls(company)] \n", "\n", "all_database = companies_database[max(companies_database, key=lambda x: len(companies_database[x]))]\n", "print(\"Number of databases : \",len(all_database))\n", "\n", "data_in_common = set(all_database)\n", "\n", "for key in companies_database:\n", " diff_database = data_in_common.symmetric_difference(companies_database[key])\n", " data_in_common = data_in_common - diff_database\n", "\n", "print(\"Number of common databases : \",len(data_in_common))" ] }, { "cell_type": "code", "execution_count": 121, "id": "0c06517d-f5b7-4104-94fa-0e3f843c5881", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'campaign_stats.csv',\n", " 'campaigns.csv',\n", " 'categories.csv',\n", " 'countries.csv',\n", " 'currencies.csv',\n", " 'customer_target_mappings.csv',\n", " 'customersplus.csv',\n", " 'event_types.csv',\n", " 'events.csv',\n", " 'facilities.csv',\n", " 'link_stats.csv',\n", " 'pricing_formulas.csv',\n", " 'product_packs.csv',\n", " 'products.csv',\n", " 'products_groups.csv',\n", " 'purchases.csv',\n", " 'representation_category_capacities.csv',\n", " 'representations.csv',\n", " 'seasons.csv',\n", " 'suppliers.csv',\n", " 'target_types.csv',\n", " 'targets.csv',\n", " 'tickets.csv'}" ] }, "execution_count": 121, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_in_common" ] }, { "cell_type": "markdown", "id": "1af245aa-44a7-453b-90f9-0c4bcc415cd0", "metadata": {}, "source": [ "## Investigate errors from data construction for company 6" ] }, { "cell_type": "code", "execution_count": 108, "id": "538a5ca2-a50d-4726-93eb-c2b0d0ab8400", "metadata": {}, "outputs": [], "source": [ "directory_path = '6'" ] }, { "cell_type": "code", "execution_count": 143, "id": "1ca3fb71-930a-441c-b35b-b98bca780606", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "File path : projet-bdc2324-team1/0_Input/Company_6/customerplus_cleaned.csv\n", "File path : projet-bdc2324-team1/0_Input/Company_6/campaigns_information.csv\n", "File path : projet-bdc2324-team1/0_Input/Company_6/products_purchased_reduced.csv\n" ] } ], "source": [ "df_customerplus_clean = display_databases(directory_path, file_name = \"customerplus_cleaned\")\n", "df_campaigns_information = display_databases(directory_path, file_name = \"campaigns_information\", datetime_col = ['opened_at', 'sent_at', 'campaign_sent_at'])\n", "df_products_purchased_reduced = display_databases(directory_path, file_name = \"products_purchased_reduced\", datetime_col = ['purchase_date'])" ] }, { "cell_type": "code", "execution_count": 144, "id": "2ad3052c-e9e6-4ef9-abe2-4b8b2306a2b9", "metadata": {}, "outputs": [], "source": [ "max_date = pd.to_datetime(final_date, utc = True, format = 'ISO8601') \n", "end_features_date = pd.to_datetime(end_of_features, utc = True, format = 'ISO8601')\n", "min_date = pd.to_datetime(start_date, utc = True, format = 'ISO8601')" ] }, { "cell_type": "code", "execution_count": 128, "id": "146999f2-ab92-4b7c-8c57-2e3ac8c4dd88", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "File path : projet-bdc2324-team1/0_Input/Company_6/campaigns_information.csv\n" ] } ], "source": [ "df_campaigns_information = display_databases(directory_path, file_name = \"campaigns_information\", datetime_col = ['opened_at', 'sent_at', 'campaign_sent_at'])" ] }, { "cell_type": "code", "execution_count": 133, "id": "7448a7b9-3edf-4177-9df2-a260ebbee45e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2022-06-15 00:00:00+0000', tz='UTC')" ] }, "execution_count": 133, "metadata": {}, "output_type": "execute_result" } ], "source": [ "end_features_date" ] }, { "cell_type": "code", "execution_count": 136, "id": "d8e954ab-65d4-4f36-8410-69bf664773a7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Shape campaigns_information : (1333010, 8)\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idcustomer_idopened_atsent_atdelivered_atcampaign_namecampaign_service_idcampaign_sent_at
0138NaT2022-08-02 18:31:33+00:00NaNAdhérents non ré-engagés152022-08-02 18:31:36+00:00
1226135NaT2022-08-02 18:31:34+00:00NaNAdhérents non ré-engagés152022-08-02 18:31:36+00:00
233876NaT2022-08-02 18:31:35+00:00NaNAdhérents non ré-engagés152022-08-02 18:31:36+00:00
3426226NaT2022-08-02 18:31:35+00:00NaNAdhérents non ré-engagés152022-08-02 18:31:36+00:00
4525349NaT2022-08-02 18:31:34+00:00NaNAdhérents non ré-engagés152022-08-02 18:31:36+00:00
\n", "
" ], "text/plain": [ " id customer_id opened_at sent_at delivered_at \\\n", "0 1 38 NaT 2022-08-02 18:31:33+00:00 NaN \n", "1 2 26135 NaT 2022-08-02 18:31:34+00:00 NaN \n", "2 3 3876 NaT 2022-08-02 18:31:35+00:00 NaN \n", "3 4 26226 NaT 2022-08-02 18:31:35+00:00 NaN \n", "4 5 25349 NaT 2022-08-02 18:31:34+00:00 NaN \n", "\n", " campaign_name campaign_service_id campaign_sent_at \n", "0 Adhérents non ré-engagés 15 2022-08-02 18:31:36+00:00 \n", "1 Adhérents non ré-engagés 15 2022-08-02 18:31:36+00:00 \n", "2 Adhérents non ré-engagés 15 2022-08-02 18:31:36+00:00 \n", "3 Adhérents non ré-engagés 15 2022-08-02 18:31:36+00:00 \n", "4 Adhérents non ré-engagés 15 2022-08-02 18:31:36+00:00 " ] }, "execution_count": 136, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(\"Shape campaigns_information : \", df_campaigns_information.shape)\n", "df_campaigns_information.head()" ] }, { "cell_type": "code", "execution_count": 134, "id": "93eceaf1-ce4c-4dfa-9c51-4fd016d09fc5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2022-08-02 18:31:33+0000', tz='UTC')" ] }, "execution_count": 134, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_campaigns_information['sent_at'].min()" ] }, { "cell_type": "code", "execution_count": 137, "id": "ea50cab4-1dae-4efe-ae3c-22b6f9ad1d26", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2023-11-07 10:08:16+0000', tz='UTC')" ] }, "execution_count": 137, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_campaigns_information['sent_at'].max()" ] }, { "cell_type": "code", "execution_count": 127, "id": "dcb87bc9-caf5-4655-9cfa-4a3dad504bac", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idcustomer_idopened_atsent_atdelivered_atcampaign_namecampaign_service_idcampaign_sent_at
\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: [id, customer_id, opened_at, sent_at, delivered_at, campaign_name, campaign_service_id, campaign_sent_at]\n", "Index: []" ] }, "execution_count": 127, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Filtre de la base df_campaigns_information\n", "df_campaigns_information = df_campaigns_information[(df_campaigns_information['sent_at'] <= end_features_date) & (df_campaigns_information['sent_at'] >= min_date)]\n", "df_campaigns_information" ] }, { "cell_type": "code", "execution_count": 145, "id": "abe22e09-a041-4349-be8f-b0784f2f0a98", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ticket_idcustomer_idpurchase_idevent_type_idsupplier_namepurchase_dateamountis_full_pricename_event_typesname_facilitiesname_categoriesname_eventsname_seasons
49914011083921259025.04caisse2022-02-27 13:44:10.690000+00:000.0Falseligue 1 uber eatsstade de l'aubehonneur basseolympique de marseillesaison 2021-2022
11753552731304136629.04adhésion2022-04-28 15:47:52.790000+00:000.0Falseligue 1 uber eatsstade de l'aubehonneur basseac ajacciosaison 2022-2023
274547400192140477.04adhésion2022-04-28 15:47:54.053000+00:000.0Falseligue 1 uber eatsstade de l'aubehonneur basserc strasbourgsaison 2022-2023
304844133138820259.04adhésion2021-08-03 13:45:01.603000+00:000.0Falseligue 1 uber eatsstade de l'aubevitoux hauteolympique de marseillesaison 2021-2022
311407271326590527.04web [adhésion]2022-05-26 09:15:40.993000+00:000.0Falseligue 1 uber eatsstade de l'aubechampagne bassestade brestois 29saison 2022-2023
\n", "
" ], "text/plain": [ " ticket_id customer_id purchase_id event_type_id supplier_name \\\n", "49 91401 108392 1259025.0 4 caisse \n", "117 535527 31304 136629.0 4 adhésion \n", "274 547400 192 140477.0 4 adhésion \n", "304 84413 31388 20259.0 4 adhésion \n", "311 407271 3265 90527.0 4 web [adhésion] \n", "\n", " purchase_date amount is_full_price \\\n", "49 2022-02-27 13:44:10.690000+00:00 0.0 False \n", "117 2022-04-28 15:47:52.790000+00:00 0.0 False \n", "274 2022-04-28 15:47:54.053000+00:00 0.0 False \n", "304 2021-08-03 13:45:01.603000+00:00 0.0 False \n", "311 2022-05-26 09:15:40.993000+00:00 0.0 False \n", "\n", " name_event_types name_facilities name_categories \\\n", "49 ligue 1 uber eats stade de l'aube honneur basse \n", "117 ligue 1 uber eats stade de l'aube honneur basse \n", "274 ligue 1 uber eats stade de l'aube honneur basse \n", "304 ligue 1 uber eats stade de l'aube vitoux haute \n", "311 ligue 1 uber eats stade de l'aube champagne basse \n", "\n", " name_events name_seasons \n", "49 olympique de marseille saison 2021-2022 \n", "117 ac ajaccio saison 2022-2023 \n", "274 rc strasbourg saison 2022-2023 \n", "304 olympique de marseille saison 2021-2022 \n", "311 stade brestois 29 saison 2022-2023 " ] }, "execution_count": 145, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Filtre de la base df_products_purchased_reduced\n", "df_products_purchased_reduced = df_products_purchased_reduced[(df_products_purchased_reduced['purchase_date'] <= end_features_date) & (df_products_purchased_reduced['purchase_date'] >= min_date)]\n", "df_products_purchased_reduced.head()" ] }, { "cell_type": "code", "execution_count": 150, "id": "ae7ef3a6-5b42-4a3c-a108-fec9f2ec4d32", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['caisse', 'adhésion', 'web [adhésion]', 'web [grand public]',\n", " 'itr ticketmaster', 'itr fnac', nan, 'decathlon', 'boutique web',\n", " 'boutique officielle'], dtype=object)" ] }, "execution_count": 150, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_products_purchased_reduced[\"supplier_name\"].unique()" ] }, { "cell_type": "code", "execution_count": 151, "id": "942f58a5-8ed4-4b18-a7a2-bd296447fa6a", "metadata": {}, "outputs": [], "source": [ "# KPI sur le comportement d'achat\n", "tickets_information_copy = df_products_purchased_reduced.copy()\n", "# Dummy : Canal de vente en ligne\n", "liste_mots = ['en ligne', 'internet', 'web', 'net', 'vad', 'online'] # vad = vente à distance\n", "tickets_information_copy['vente_internet'] = tickets_information_copy['supplier_name'].fillna('').str.contains('|'.join(liste_mots), case=False).astype(int)" ] }, { "cell_type": "markdown", "id": "658b57cd-4fb8-4552-a582-972144b2af1c", "metadata": {}, "source": [ "tickets_information_copy['vente_internet'] corrected by handling na" ] }, { "cell_type": "markdown", "id": "99a75c34-f393-433a-b3c2-dc3f6f2f3e7e", "metadata": {}, "source": [ "## Investigate train and test" ] }, { "cell_type": "code", "execution_count": 6, "id": "970302f5-4de2-46b4-a1ce-a5396f5330ab", "metadata": {}, "outputs": [], "source": [ "def display_databases(directory_path, file_name):\n", " \"\"\"\n", " This function returns the file from s3 storage \n", " \"\"\"\n", " file_path = \"projet-bdc2324-team1\" + \"/Generalization/\" + directory_path + \"/\" + file_name + \".csv\"\n", " print(\"File path : \", file_path)\n", " with fs.open(file_path, mode=\"rb\") as file_in:\n", " df = pd.read_csv(file_in, sep=\",\") \n", " return df " ] }, { "cell_type": "code", "execution_count": 11, "id": "f5bfae82-04aa-44e1-9869-3f4fd5736b41", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "File path : projet-bdc2324-team1/Generalization/sport/Train_set.csv\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
customer_idnb_ticketsnb_purchasestotal_amountnb_suppliersvente_internet_maxpurchase_date_minpurchase_date_maxtime_between_purchasenb_tickets_internet...countrygender_labelgender_femalegender_malegender_othercountry_frnb_campaignsnb_campaigns_openedtime_to_openy_has_purchased
05_60466520.00.00.00.00.00.00.00.00.0...afother0010.00.00.000.0
15_37891590.00.00.00.00.00.00.00.00.0...frmale0101.00.00.000.0
25_59911480.00.00.00.00.00.00.00.00.0...afother0010.00.00.000.0
35_38480650.00.00.00.00.00.00.00.00.0...frmale0101.00.00.000.0
45_61544950.00.00.00.00.00.00.00.00.0...afother0010.00.00.000.0
\n", "

5 rows × 40 columns

\n", "
" ], "text/plain": [ " customer_id nb_tickets nb_purchases total_amount nb_suppliers \\\n", "0 5_6046652 0.0 0.0 0.0 0.0 \n", "1 5_3789159 0.0 0.0 0.0 0.0 \n", "2 5_5991148 0.0 0.0 0.0 0.0 \n", "3 5_3848065 0.0 0.0 0.0 0.0 \n", "4 5_6154495 0.0 0.0 0.0 0.0 \n", "\n", " vente_internet_max purchase_date_min purchase_date_max \\\n", "0 0.0 0.0 0.0 \n", "1 0.0 0.0 0.0 \n", "2 0.0 0.0 0.0 \n", "3 0.0 0.0 0.0 \n", "4 0.0 0.0 0.0 \n", "\n", " time_between_purchase nb_tickets_internet ... country gender_label \\\n", "0 0.0 0.0 ... af other \n", "1 0.0 0.0 ... fr male \n", "2 0.0 0.0 ... af other \n", "3 0.0 0.0 ... fr male \n", "4 0.0 0.0 ... af other \n", "\n", " gender_female gender_male gender_other country_fr nb_campaigns \\\n", "0 0 0 1 0.0 0.0 \n", "1 0 1 0 1.0 0.0 \n", "2 0 0 1 0.0 0.0 \n", "3 0 1 0 1.0 0.0 \n", "4 0 0 1 0.0 0.0 \n", "\n", " nb_campaigns_opened time_to_open y_has_purchased \n", "0 0.0 0 0.0 \n", "1 0.0 0 0.0 \n", "2 0.0 0 0.0 \n", "3 0.0 0 0.0 \n", "4 0.0 0 0.0 \n", "\n", "[5 rows x 40 columns]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train_sport = display_databases('sport', 'Train_set').fillna(0)\n", "train_sport.head()" ] }, { "cell_type": "code", "execution_count": 10, "id": "56d5b12e-45e8-4312-869d-bde4d24900b6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "shape : (426449, 40)\n", "number of na explained variable : 369102\n" ] } ], "source": [ "print('shape : ', train_sport.shape) \n", "print('number of na explained variable : ', train_sport['y_has_purchased'].isna().sum())" ] }, { "cell_type": "code", "execution_count": 12, "id": "13bff83a-e931-4286-a3f2-1382462703f4", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAGxCAYAAACgDPi4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8g+/7EAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA8w0lEQVR4nO3df1RUdeL/8deEMpLCRCE/xlh/fEpWwtwNOopWlAlogVnb6i41ySdjazE5hGQf61urfkoqf7XpZ61tK1djlz67RltpfCBLjFX8wTK7YOR6Wg1cQaxgELKB8H7/6HBPI2pK1xB7Ps655zj3vube99w9s7563ztXm2EYhgAAAPCtXdDbAwAAADhfUKwAAAAsQrECAACwCMUKAADAIhQrAAAAi1CsAAAALEKxAgAAsAjFCgAAwCL9ensA3zfHjh3TwYMHFRgYKJvN1tvDAQAAp8EwDB05ckROp1MXXHDyeSmK1Xfs4MGDioyM7O1hAACAHqirq9Oll1560u0Uq+9YYGCgpK/+hwkKCurl0QAAgNPR0tKiyMhI8+/xk6FYfce6Lv8FBQVRrAAA6GO+6TYebl4HAACwCMUKAADAIhQrAAAAi1CsAAAALEKxAgAAsAjFCgAAwCIUKwAAAItQrAAAACxCsQIAALAIxQoAAMAiFCsAAACLUKwAAAAsQrECAACwCMUKAADAIhQrAAAAi/Tr7QHAerEPru3tIQDnpIold/X2EAC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", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import seaborn as sns\n", "\n", "sns.countplot(train_sport, x='y_has_purchased')" ] }, { "cell_type": "code", "execution_count": 5, "id": "d056c7b3-0e8c-485c-b2f3-4681077f1c2e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['projet-bdc2324-team1/Generalization/sport/Test_set',\n", " 'projet-bdc2324-team1/Generalization/sport/Test_set.csv',\n", " 'projet-bdc2324-team1/Generalization/sport/Train_set',\n", " 'projet-bdc2324-team1/Generalization/sport/Train_set.csv']" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fs.ls('projet-bdc2324-team1/Generalization/sport')" ] }, { "cell_type": "markdown", "id": "6a9963be-e17b-4cb3-a795-35cece44ce97", "metadata": {}, "source": [ "## Look at y_has_purchased" ] }, { "cell_type": "code", "execution_count": 75, "id": "907bb25a-b555-4cfa-bfc9-785120ae4292", "metadata": {}, "outputs": [], "source": [ "def display_databases(directory_path, file_name, datetime_col = None):\n", " \"\"\"\n", " This function returns the file from s3 storage \n", " \"\"\"\n", " file_path = \"projet-bdc2324-team1\" + \"/0_Input/Company_\" + directory_path + \"/\" + file_name + \".csv\"\n", " print(\"File path : \", file_path)\n", " with fs.open(file_path, mode=\"rb\") as file_in:\n", " df = pd.read_csv(file_in, sep=\",\", parse_dates = datetime_col, date_parser=custom_date_parser) \n", " return df " ] }, { "cell_type": "code", "execution_count": 76, "id": "d3164f81-0ef2-4f12-bc56-b7a999c4a9cd", "metadata": {}, "outputs": [], "source": [ "directory_path = '5'\n", "# start_date, end_of_features, final_date = df_coverage_modelization(list_of_comp, coverage_train = 0.7)\n", "min_date = \"2021-05-01\"\n", "end_features_date = \"2022-11-01\"\n", "max_date = \"2023-11-01\"" ] }, { "cell_type": "code", "execution_count": 60, "id": "7cb31d80-41ca-4c2b-89b6-ee50486e7298", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "File path : projet-bdc2324-team1/0_Input/Company_5/customerplus_cleaned.csv\n", "File path : projet-bdc2324-team1/0_Input/Company_5/campaigns_information.csv\n", "File path : projet-bdc2324-team1/0_Input/Company_5/products_purchased_reduced.csv\n" ] } ], "source": [ "df_customerplus_clean_0 = display_databases(directory_path, file_name = \"customerplus_cleaned\")\n", "df_campaigns_information = display_databases(directory_path, file_name = \"campaigns_information\",\n", " datetime_col = ['opened_at', 'sent_at', 'campaign_sent_at'])\n", "df_products_purchased_reduced = display_databases(directory_path, file_name = \"products_purchased_reduced\",\n", " datetime_col = ['purchase_date'])\n", "\n", "# Filtre de cohérence pour la mise en pratique de notre méthode\n", "max_date = pd.to_datetime(max_date, utc = True, format = 'ISO8601') \n", "end_features_date = pd.to_datetime(end_features_date, utc = True, format = 'ISO8601')\n", "min_date = pd.to_datetime(min_date, utc = True, format = 'ISO8601')\n", "\n", "df_campaigns_information = df_campaigns_information[(df_campaigns_information['sent_at'] <= end_features_date) & (df_campaigns_information['sent_at'] >= min_date)]\n", "df_campaigns_information['opened_at'][df_campaigns_information['opened_at'] >= end_features_date] = np.datetime64('NaT')\n", "\n", "#Filtre de la base df_products_purchased_reduced\n", "df_products_purchased_reduced = df_products_purchased_reduced[(df_products_purchased_reduced['purchase_date'] <= end_features_date) & (df_products_purchased_reduced['purchase_date'] >= min_date)]\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 61, "id": "1d63a61e-22b4-4224-89d4-18444276cfaa", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idcustomer_idopened_atsent_atdelivered_atcampaign_namecampaign_service_idcampaign_sent_at
\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: [id, customer_id, opened_at, sent_at, delivered_at, campaign_name, campaign_service_id, campaign_sent_at]\n", "Index: []" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_campaigns_information.head()" ] }, { "cell_type": "code", "execution_count": 62, "id": "a27a80c1-0be2-4199-96e7-566d568b1f51", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ticket_idcustomer_idpurchase_idevent_type_idsupplier_namepurchase_dateamountis_full_pricename_event_typesname_facilitiesname_categoriesname_eventsname_seasonsstart_date_timeend_date_timeopen
06287839204007545836.0824fov2022-03-31 03:42:59+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
16287840204007545836.0824fov2022-03-31 03:42:59+00:0030.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
26154548227006535225.0824fov2022-02-28 16:31:29+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
36154549227006535225.0824fov2022-02-28 16:31:29+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
46287843407930545838.0824fov2022-03-31 04:00:22+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
\n", "
" ], "text/plain": [ " ticket_id customer_id purchase_id event_type_id supplier_name \\\n", "0 6287839 204007 545836.0 824 fov \n", "1 6287840 204007 545836.0 824 fov \n", "2 6154548 227006 535225.0 824 fov \n", "3 6154549 227006 535225.0 824 fov \n", "4 6287843 407930 545838.0 824 fov \n", "\n", " purchase_date amount is_full_price name_event_types \\\n", "0 2022-03-31 03:42:59+00:00 55.0 False match rugby \n", "1 2022-03-31 03:42:59+00:00 30.0 False match rugby \n", "2 2022-02-28 16:31:29+00:00 55.0 False match rugby \n", "3 2022-02-28 16:31:29+00:00 55.0 False match rugby \n", "4 2022-03-31 04:00:22+00:00 55.0 False match rugby \n", "\n", " name_facilities name_categories name_events \\\n", "0 jean bouin centrale sf paris / racing 92 (ercc) \n", "1 jean bouin centrale sf paris / racing 92 (ercc) \n", "2 jean bouin centrale sf paris / racing 92 (ercc) \n", "3 jean bouin centrale sf paris / racing 92 (ercc) \n", "4 jean bouin centrale sf paris / racing 92 (ercc) \n", "\n", " name_seasons start_date_time end_date_time \\\n", "0 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "1 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "2 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "3 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "4 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "\n", " open \n", "0 True \n", "1 True \n", "2 True \n", "3 True \n", "4 True " ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_products_purchased_reduced.head()" ] }, { "cell_type": "code", "execution_count": 63, "id": "f47357ab-0216-4f70-ab8f-6767819e1cdb", "metadata": {}, "outputs": [], "source": [ "# Fusion de l'ensemble et creation des KPI\n", "\n", "# KPI sur les campagnes publicitaires\n", "df_campaigns_kpi = campaigns_kpi_function(campaigns_information = df_campaigns_information) \n", "\n", "# KPI sur le comportement d'achat\n", "df_tickets_kpi = tickets_kpi_function(tickets_information = df_products_purchased_reduced)\n", "\n", "# KPI sur les données socio-démographiques\n", "df_customerplus_clean = customerplus_kpi_function(customerplus_clean = df_customerplus_clean_0)" ] }, { "cell_type": "code", "execution_count": 65, "id": "3d08a2f8-3c83-41c7-98f8-4be268ffa0da", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
customer_idstreet_idstructure_idmcp_contact_idfidelitytenant_idis_partnerdeleted_atgenderis_email_true...first_buying_datecountrygender_labelgender_femalegender_malegender_othercountry_frnb_campaignsnb_campaigns_openedtime_to_open
060097451372685NaNNaN01771FalseNaN2True...NaNafother0010.0NaNNaNNaT
160112281372685NaNNaN01771FalseNaN2True...NaNafother0010.0NaNNaNNaT
260589501372685NaNNaN01771FalseNaN2True...NaNafother0010.0NaNNaNNaT
360624041372685NaNNaN01771FalseNaN2True...NaNafother0010.0NaNNaNNaT
425021778785NaN11035.001771FalseNaN0True...NaNfrfemale1001.0NaNNaNNaT
\n", "

5 rows × 30 columns

\n", "
" ], "text/plain": [ " customer_id street_id structure_id mcp_contact_id fidelity tenant_id \\\n", "0 6009745 1372685 NaN NaN 0 1771 \n", "1 6011228 1372685 NaN NaN 0 1771 \n", "2 6058950 1372685 NaN NaN 0 1771 \n", "3 6062404 1372685 NaN NaN 0 1771 \n", "4 250217 78785 NaN 11035.0 0 1771 \n", "\n", " is_partner deleted_at gender is_email_true ... first_buying_date \\\n", "0 False NaN 2 True ... NaN \n", "1 False NaN 2 True ... NaN \n", "2 False NaN 2 True ... NaN \n", "3 False NaN 2 True ... NaN \n", "4 False NaN 0 True ... NaN \n", "\n", " country gender_label gender_female gender_male gender_other country_fr \\\n", "0 af other 0 0 1 0.0 \n", "1 af other 0 0 1 0.0 \n", "2 af other 0 0 1 0.0 \n", "3 af other 0 0 1 0.0 \n", "4 fr female 1 0 0 1.0 \n", "\n", " nb_campaigns nb_campaigns_opened time_to_open \n", "0 NaN NaN NaT \n", "1 NaN NaN NaT \n", "2 NaN NaN NaT \n", "3 NaN NaN NaT \n", "4 NaN NaN NaT \n", "\n", "[5 rows x 30 columns]" ] }, "execution_count": 65, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Fusion avec KPI liés au customer\n", "df_customer = pd.merge(df_customerplus_clean, df_campaigns_kpi, on = 'customer_id', how = 'left')\n", "df_customer.head()" ] }, { "cell_type": "code", "execution_count": 66, "id": "bc3d1aed-b2af-48e5-a920-626f2abc3358", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
customer_idnb_ticketsnb_purchasestotal_amountnb_suppliersvente_internet_maxpurchase_date_minpurchase_date_maxtime_between_purchasenb_tickets_internet...first_buying_datecountrygender_labelgender_femalegender_malegender_othercountry_frnb_campaignsnb_campaigns_openedtime_to_open
0160516149.03.04470.01.00.0409.69313766.356979343.3361570.0...2021-09-17 06:39:19+00:00frmale0101.00.00.0NaT
11605171977.027.01473.02.01.0431.55851927.733472403.82504615.0...2021-08-26 09:53:10+00:00frfemale1001.00.00.0NaT
2160518116.08.0439.02.00.0427.17772023.689340403.4883800.0...2021-08-30 19:01:31+00:00frmale0101.00.00.0NaT
316051934.02.0608.01.00.0483.642940108.777870374.8650690.0...2019-05-21 08:03:52+00:00frfemale1001.00.00.0NaT
4160520207.05.00.01.00.0431.55001269.310266362.2397450.0...2019-08-20 15:10:07+00:00frmale0101.00.00.0NaT
\n", "

5 rows × 39 columns

\n", "
" ], "text/plain": [ " customer_id nb_tickets nb_purchases total_amount nb_suppliers \\\n", "0 160516 149.0 3.0 4470.0 1.0 \n", "1 160517 1977.0 27.0 1473.0 2.0 \n", "2 160518 116.0 8.0 439.0 2.0 \n", "3 160519 34.0 2.0 608.0 1.0 \n", "4 160520 207.0 5.0 0.0 1.0 \n", "\n", " vente_internet_max purchase_date_min purchase_date_max \\\n", "0 0.0 409.693137 66.356979 \n", "1 1.0 431.558519 27.733472 \n", "2 0.0 427.177720 23.689340 \n", "3 0.0 483.642940 108.777870 \n", "4 0.0 431.550012 69.310266 \n", "\n", " time_between_purchase nb_tickets_internet ... first_buying_date \\\n", "0 343.336157 0.0 ... 2021-09-17 06:39:19+00:00 \n", "1 403.825046 15.0 ... 2021-08-26 09:53:10+00:00 \n", "2 403.488380 0.0 ... 2021-08-30 19:01:31+00:00 \n", "3 374.865069 0.0 ... 2019-05-21 08:03:52+00:00 \n", "4 362.239745 0.0 ... 2019-08-20 15:10:07+00:00 \n", "\n", " country gender_label gender_female gender_male gender_other \\\n", "0 fr male 0 1 0 \n", "1 fr female 1 0 0 \n", "2 fr male 0 1 0 \n", "3 fr female 1 0 0 \n", "4 fr male 0 1 0 \n", "\n", " country_fr nb_campaigns nb_campaigns_opened time_to_open \n", "0 1.0 0.0 0.0 NaT \n", "1 1.0 0.0 0.0 NaT \n", "2 1.0 0.0 0.0 NaT \n", "3 1.0 0.0 0.0 NaT \n", "4 1.0 0.0 0.0 NaT \n", "\n", "[5 rows x 39 columns]" ] }, "execution_count": 66, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_customer[['nb_campaigns', 'nb_campaigns_opened']] = df_customer[['nb_campaigns', 'nb_campaigns_opened']].fillna(0)\n", "# Fusion avec KPI liés au comportement d'achat\n", "df_customer_product = pd.merge(df_tickets_kpi, df_customer, on = 'customer_id', how = 'outer')\n", "df_customer_product.head()" ] }, { "cell_type": "code", "execution_count": 67, "id": "5549e265-3904-464b-964b-518a84a42503", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ticket_idcustomer_idpurchase_idevent_type_idsupplier_namepurchase_dateamountis_full_pricename_event_typesname_facilitiesname_categoriesname_eventsname_seasonsstart_date_timeend_date_timeopen
\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: [ticket_id, customer_id, purchase_id, event_type_id, supplier_name, purchase_date, amount, is_full_price, name_event_types, name_facilities, name_categories, name_events, name_seasons, start_date_time, end_date_time, open]\n", "Index: []" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Fill NaN values\n", "df_customer_product[['nb_tickets', 'nb_purchases', 'total_amount', 'nb_suppliers', 'vente_internet_max', 'nb_tickets_internet']] = df_customer_product[['nb_tickets', 'nb_purchases', 'total_amount', 'nb_suppliers', 'vente_internet_max', 'nb_tickets_internet']].fillna(0)\n", "\n", "# 2. Construction of the explained variable \n", "df_products_purchased_to_predict = df_products_purchased_reduced[(df_products_purchased_reduced['purchase_date'] <= max_date) & (df_products_purchased_reduced['purchase_date'] > end_features_date)]\n", "df_products_purchased_to_predict.head()\n" ] }, { "cell_type": "code", "execution_count": 68, "id": "be182c6c-012f-447d-a57f-03da65da53f7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\n", "['2022-03-31 03:42:59+00:00', '2022-02-28 16:31:29+00:00',\n", " '2022-03-31 04:00:22+00:00', '2022-03-31 04:09:18+00:00',\n", " '2022-03-25 15:50:52+00:00', '2022-08-01 10:05:49+00:00',\n", " '2021-08-26 12:17:40+00:00', '2022-08-02 06:32:37+00:00',\n", " '2022-06-30 09:16:59+00:00', '2022-07-03 13:53:30+00:00',\n", " ...\n", " '2022-01-26 11:34:05+00:00', '2022-01-21 17:07:25+00:00',\n", " '2022-01-26 13:43:23+00:00', '2022-01-26 14:38:05+00:00',\n", " '2022-01-26 14:39:19+00:00', '2022-01-26 14:40:12+00:00',\n", " '2022-01-26 14:41:17+00:00', '2022-01-27 08:16:02+00:00',\n", " '2022-01-27 08:45:25+00:00', '2022-01-27 11:57:11+00:00']\n", "Length: 49543, dtype: datetime64[ns, UTC]" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_products_purchased_reduced['purchase_date'].unique()" ] }, { "cell_type": "code", "execution_count": 72, "id": "aab1cc7e-79be-403c-b9c1-4f4f333b13ff", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ticket_idcustomer_idpurchase_idevent_type_idsupplier_namepurchase_dateamountis_full_pricename_event_typesname_facilitiesname_categoriesname_eventsname_seasonsstart_date_timeend_date_timeopen
06287839204007545836.0824fov2022-03-31 03:42:59+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
16287840204007545836.0824fov2022-03-31 03:42:59+00:0030.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
26154548227006535225.0824fov2022-02-28 16:31:29+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
36154549227006535225.0824fov2022-02-28 16:31:29+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
46287843407930545838.0824fov2022-03-31 04:00:22+00:0055.0Falsematch rugbyjean bouincentralesf paris / racing 92 (ercc)saison 2021 - 20222022-04-08 22:00:00+02:001901-01-01 00:09:21+00:09True
\n", "
" ], "text/plain": [ " ticket_id customer_id purchase_id event_type_id supplier_name \\\n", "0 6287839 204007 545836.0 824 fov \n", "1 6287840 204007 545836.0 824 fov \n", "2 6154548 227006 535225.0 824 fov \n", "3 6154549 227006 535225.0 824 fov \n", "4 6287843 407930 545838.0 824 fov \n", "\n", " purchase_date amount is_full_price name_event_types \\\n", "0 2022-03-31 03:42:59+00:00 55.0 False match rugby \n", "1 2022-03-31 03:42:59+00:00 30.0 False match rugby \n", "2 2022-02-28 16:31:29+00:00 55.0 False match rugby \n", "3 2022-02-28 16:31:29+00:00 55.0 False match rugby \n", "4 2022-03-31 04:00:22+00:00 55.0 False match rugby \n", "\n", " name_facilities name_categories name_events \\\n", "0 jean bouin centrale sf paris / racing 92 (ercc) \n", "1 jean bouin centrale sf paris / racing 92 (ercc) \n", "2 jean bouin centrale sf paris / racing 92 (ercc) \n", "3 jean bouin centrale sf paris / racing 92 (ercc) \n", "4 jean bouin centrale sf paris / racing 92 (ercc) \n", "\n", " name_seasons start_date_time end_date_time \\\n", "0 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "1 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "2 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "3 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "4 saison 2021 - 2022 2022-04-08 22:00:00+02:00 1901-01-01 00:09:21+00:09 \n", "\n", " open \n", "0 True \n", "1 True \n", "2 True \n", "3 True \n", "4 True " ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_products_purchased_reduced[(df_products_purchased_reduced['purchase_date'] <= max_date)].head()" ] }, { "cell_type": "code", "execution_count": 74, "id": "ce59de67-127e-4b0a-b96c-9684d87792dd", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Timestamp('2022-10-31 23:17:26+0000', tz='UTC')" ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_products_purchased_reduced['purchase_date'].max()" ] }, { "cell_type": "code", "execution_count": null, "id": "184463d1-b0dd-44b9-a9a3-4ab32c8c13c1", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.6" } }, "nbformat": 4, "nbformat_minor": 5 }