{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "b43ceb5f", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "ce571404", "metadata": {}, "source": [ "\n", "**Objective and Focus:**\n", "\n", "Our primary goal is to enhance marketing strategies among existing clients who are not currently making purchases, aiming to stimulate their interest in buying. This initiative emphasizes addressing false positives to effectively convert potential clients.\n", "\n", "In contrast, if our aim were to encourage repeat purchases from existing buyers, our strategy would shift. We would focus on understanding:\n", "\n", "- The demographic profile of non-purchasing clients.\n", "- Identifying reasons behind their lack of purchases:\n", " - Are they satisfied with another brand?\n", " - Are financial constraints influencing their decision? Insights from their salary can provide clarity.\n", " - Are they occasional buyers who only purchase when there's a specific need?\n" ] }, { "cell_type": "code", "execution_count": 317, "id": "17a19462", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 318, "id": "33ece9a4", "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv(r\"C:\\Users\\Teni\\Desktop\\Git-Github\\Datasets\\Logistic Regression\\car_data.csv\")" ] }, { "cell_type": "code", "execution_count": 319, "id": "1171b36d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | User ID | \n", "Gender | \n", "Age | \n", "AnnualSalary | \n", "Purchased | \n", "
---|---|---|---|---|---|
0 | \n", "385 | \n", "Male | \n", "35 | \n", "20000 | \n", "0 | \n", "
1 | \n", "681 | \n", "Male | \n", "40 | \n", "43500 | \n", "0 | \n", "
2 | \n", "353 | \n", "Male | \n", "49 | \n", "74000 | \n", "0 | \n", "
3 | \n", "895 | \n", "Male | \n", "40 | \n", "107500 | \n", "1 | \n", "
4 | \n", "661 | \n", "Male | \n", "25 | \n", "79000 | \n", "0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
995 | \n", "863 | \n", "Male | \n", "38 | \n", "59000 | \n", "0 | \n", "
996 | \n", "800 | \n", "Female | \n", "47 | \n", "23500 | \n", "0 | \n", "
997 | \n", "407 | \n", "Female | \n", "28 | \n", "138500 | \n", "1 | \n", "
998 | \n", "299 | \n", "Female | \n", "48 | \n", "134000 | \n", "1 | \n", "
999 | \n", "687 | \n", "Female | \n", "44 | \n", "73500 | \n", "0 | \n", "
1000 rows × 5 columns
\n", "\n", " | Gender | \n", "Age | \n", "AnnualSalary | \n", "Purchased | \n", "
---|---|---|---|---|
0 | \n", "Male | \n", "35 | \n", "20000 | \n", "0 | \n", "
1 | \n", "Male | \n", "40 | \n", "43500 | \n", "0 | \n", "
2 | \n", "Male | \n", "49 | \n", "74000 | \n", "0 | \n", "
3 | \n", "Male | \n", "40 | \n", "107500 | \n", "1 | \n", "
4 | \n", "Male | \n", "25 | \n", "79000 | \n", "0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
995 | \n", "Male | \n", "38 | \n", "59000 | \n", "0 | \n", "
996 | \n", "Female | \n", "47 | \n", "23500 | \n", "0 | \n", "
997 | \n", "Female | \n", "28 | \n", "138500 | \n", "1 | \n", "
998 | \n", "Female | \n", "48 | \n", "134000 | \n", "1 | \n", "
999 | \n", "Female | \n", "44 | \n", "73500 | \n", "0 | \n", "
1000 rows × 4 columns
\n", "\n", " | Age | \n", "AnnualSalary | \n", "Purchased | \n", "Gender_Female | \n", "Gender_Male | \n", "
---|---|---|---|---|---|
0 | \n", "35 | \n", "20000 | \n", "0 | \n", "0 | \n", "1 | \n", "
1 | \n", "40 | \n", "43500 | \n", "0 | \n", "0 | \n", "1 | \n", "
2 | \n", "49 | \n", "74000 | \n", "0 | \n", "0 | \n", "1 | \n", "
3 | \n", "40 | \n", "107500 | \n", "1 | \n", "0 | \n", "1 | \n", "
4 | \n", "25 | \n", "79000 | \n", "0 | \n", "0 | \n", "1 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
995 | \n", "38 | \n", "59000 | \n", "0 | \n", "0 | \n", "1 | \n", "
996 | \n", "47 | \n", "23500 | \n", "0 | \n", "1 | \n", "0 | \n", "
997 | \n", "28 | \n", "138500 | \n", "1 | \n", "1 | \n", "0 | \n", "
998 | \n", "48 | \n", "134000 | \n", "1 | \n", "1 | \n", "0 | \n", "
999 | \n", "44 | \n", "73500 | \n", "0 | \n", "1 | \n", "0 | \n", "
1000 rows × 5 columns
\n", "\n", " | Age | \n", "AnnualSalary | \n", "Purchased | \n", "Gender_Female | \n", "
---|---|---|---|---|
0 | \n", "35 | \n", "20000 | \n", "0 | \n", "0 | \n", "
1 | \n", "40 | \n", "43500 | \n", "0 | \n", "0 | \n", "
2 | \n", "49 | \n", "74000 | \n", "0 | \n", "0 | \n", "
3 | \n", "40 | \n", "107500 | \n", "1 | \n", "0 | \n", "
4 | \n", "25 | \n", "79000 | \n", "0 | \n", "0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
995 | \n", "38 | \n", "59000 | \n", "0 | \n", "0 | \n", "
996 | \n", "47 | \n", "23500 | \n", "0 | \n", "1 | \n", "
997 | \n", "28 | \n", "138500 | \n", "1 | \n", "1 | \n", "
998 | \n", "48 | \n", "134000 | \n", "1 | \n", "1 | \n", "
999 | \n", "44 | \n", "73500 | \n", "0 | \n", "1 | \n", "
1000 rows × 4 columns
\n", "\n", " | Age | \n", "AnnualSalary | \n", "Purchased | \n", "female_gender | \n", "
---|---|---|---|---|
0 | \n", "35 | \n", "20000 | \n", "0 | \n", "0 | \n", "
1 | \n", "40 | \n", "43500 | \n", "0 | \n", "0 | \n", "
2 | \n", "49 | \n", "74000 | \n", "0 | \n", "0 | \n", "
3 | \n", "40 | \n", "107500 | \n", "1 | \n", "0 | \n", "
4 | \n", "25 | \n", "79000 | \n", "0 | \n", "0 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
995 | \n", "38 | \n", "59000 | \n", "0 | \n", "0 | \n", "
996 | \n", "47 | \n", "23500 | \n", "0 | \n", "1 | \n", "
997 | \n", "28 | \n", "138500 | \n", "1 | \n", "1 | \n", "
998 | \n", "48 | \n", "134000 | \n", "1 | \n", "1 | \n", "
999 | \n", "44 | \n", "73500 | \n", "0 | \n", "1 | \n", "
1000 rows × 4 columns
\n", "\n", " | Age | \n", "AnnualSalary | \n", "Purchased | \n", "female_gender | \n", "
---|---|---|---|---|
count | \n", "1000.000000 | \n", "1000.000000 | \n", "1000.000000 | \n", "1000.000000 | \n", "
mean | \n", "40.106000 | \n", "72689.000000 | \n", "0.402000 | \n", "0.516000 | \n", "
std | \n", "10.707073 | \n", "34488.341867 | \n", "0.490547 | \n", "0.499994 | \n", "
min | \n", "18.000000 | \n", "15000.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
25% | \n", "32.000000 | \n", "46375.000000 | \n", "0.000000 | \n", "0.000000 | \n", "
50% | \n", "40.000000 | \n", "72000.000000 | \n", "0.000000 | \n", "1.000000 | \n", "
75% | \n", "48.000000 | \n", "90000.000000 | \n", "1.000000 | \n", "1.000000 | \n", "
max | \n", "63.000000 | \n", "152500.000000 | \n", "1.000000 | \n", "1.000000 | \n", "