minor change

This commit is contained in:
Thomas PIQUE 2024-03-27 15:06:31 +00:00
parent 10fde045e5
commit f55ade48b4
2 changed files with 11 additions and 16 deletions

View File

@ -48,15 +48,12 @@ model = load_model(type_of_activity, model_name)
### Preprocessing of data
X_test = dataset_test[['nb_tickets', 'nb_purchases', 'total_amount', 'nb_suppliers', 'vente_internet_max', 'purchase_date_min', 'purchase_date_max',
'time_between_purchase', 'nb_tickets_internet', 'is_email_true', 'opt_in', #'is_partner',
'gender_female', 'gender_male', 'gender_other', 'nb_campaigns', 'nb_campaigns_opened']]
'gender_female', 'gender_male', 'gender_other', 'nb_campaigns', 'nb_campaigns_opened', 'country_fr']]
y_test = dataset_test[['y_has_purchased']]
X_test_segment = X_test
X_test_segment.insert(X_test.shape[1], "country_fr", dataset_test["country_fr"])
# add y_has_purchased to X_test
X_test_segment["has_purchased"] = y_test
@ -100,5 +97,3 @@ categories = list(X_test_segment_caract.drop("segment", axis=1).columns)
radar_mp_plot_all(df=X_test_segment_caract, categories=categories)
save_file_s3_mp(File_name = "spider_chart_all_", type_of_activity = activity)

View File

@ -484,7 +484,7 @@
},
{
"cell_type": "code",
"execution_count": 88,
"execution_count": 180,
"id": "e4287c1a-eab6-4897-91d6-d21804518dc4",
"metadata": {},
"outputs": [
@ -884,7 +884,7 @@
"[96096 rows x 21 columns]"
]
},
"execution_count": 88,
"execution_count": 180,
"metadata": {},
"output_type": "execute_result"
}
@ -893,14 +893,14 @@
"# Processing\n",
"X_test = dataset_test[['nb_tickets', 'nb_purchases', 'total_amount', 'nb_suppliers', 'vente_internet_max', 'purchase_date_min', 'purchase_date_max', \n",
" 'time_between_purchase', 'nb_tickets_internet', 'is_email_true', 'opt_in', #'is_partner',\n",
" 'gender_female', 'gender_male', 'gender_other', 'nb_campaigns', 'nb_campaigns_opened']]\n",
" 'gender_female', 'gender_male', 'gender_other', 'nb_campaigns', 'nb_campaigns_opened', 'country_fr']]\n",
"\n",
"y_test = dataset_test[['y_has_purchased']]\n",
"\n",
"\n",
"X_test_segment = X_test\n",
"\n",
"X_test_segment.insert(X_test.shape[1], \"country_fr\", dataset_test[\"country_fr\"])\n",
"# X_test_segment.insert(X_test.shape[1], \"country_fr\", dataset_test[\"country_fr\"])\n",
"\n",
"# add y_has_purchased to X_test\n",
"X_test_segment[\"has_purchased\"] = y_test\n",
@ -929,7 +929,7 @@
},
{
"cell_type": "code",
"execution_count": 106,
"execution_count": 181,
"id": "3067d919-50c9-49e9-b0a6-b676a5dbae56",
"metadata": {},
"outputs": [
@ -1022,7 +1022,7 @@
"4 112518.0 "
]
},
"execution_count": 106,
"execution_count": 181,
"metadata": {},
"output_type": "execute_result"
}
@ -1051,7 +1051,7 @@
},
{
"cell_type": "code",
"execution_count": 172,
"execution_count": 182,
"id": "bd63d787-3ef8-4f23-9069-e9b16b4a0de8",
"metadata": {},
"outputs": [
@ -1133,7 +1133,7 @@
"3 4 9.345862 78.717714 68.223837 82.758529 15.937376"
]
},
"execution_count": 172,
"execution_count": 182,
"metadata": {},
"output_type": "execute_result"
}
@ -1467,7 +1467,7 @@
},
{
"cell_type": "code",
"execution_count": 166,
"execution_count": 183,
"id": "5f908232-b0fe-4707-a8c5-5cadb7d8653f",
"metadata": {},
"outputs": [
@ -1560,7 +1560,7 @@
"3 0.170582 0.657373 "
]
},
"execution_count": 166,
"execution_count": 183,
"metadata": {},
"output_type": "execute_result"
}