{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Customer Churn Dataset - Analysis Notebook\n",
        "\n",
        "## Project Information\n",
        "\n",
        "**Provided by:** RSK World  \n",
        "**Website:** https://rskworld.in/  \n",
        "**Email:** help@rskworld.in  \n",
        "**Phone:** +91 93305 39277  \n",
        "**Contact Page:** https://rskworld.in/contact.php\n",
        "\n",
        "**Project:** Customer Churn Dataset  \n",
        "**Category:** Tabular Data  \n",
        "**Difficulty:** Beginner  \n",
        "**Technologies:** CSV, Excel, Pandas, NumPy\n",
        "\n",
        "---\n",
        "\n",
        "This notebook provides comprehensive analysis of the Customer Churn Dataset, including data exploration, visualization, preprocessing, and predictive modeling.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 1. Import Libraries\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "import seaborn as sns\n",
        "import warnings\n",
        "warnings.filterwarnings('ignore')\n",
        "\n",
        "# Set style\n",
        "sns.set_style('whitegrid')\n",
        "plt.rcParams['figure.figsize'] = (12, 6)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 2. Load Dataset\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Load the dataset\n",
        "df = pd.read_csv('../data/customer_churn.csv')\n",
        "\n",
        "# Display basic information\n",
        "print(\"Dataset Shape:\", df.shape)\n",
        "print(\"\\nColumn Names:\")\n",
        "print(df.columns.tolist())\n",
        "print(\"\\nFirst 5 rows:\")\n",
        "df.head()\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 3. Data Exploration\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Dataset info\n",
        "df.info()\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Statistical summary\n",
        "df.describe()\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Check for missing values\n",
        "missing_values = df.isnull().sum()\n",
        "print(\"Missing Values:\")\n",
        "print(missing_values[missing_values > 0])\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 4. Churn Analysis\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Churn distribution\n",
        "churn_counts = df['Churn'].value_counts()\n",
        "print(\"Churn Distribution:\")\n",
        "print(churn_counts)\n",
        "print(\"\\nChurn Percentage:\")\n",
        "print(df['Churn'].value_counts(normalize=True) * 100)\n",
        "\n",
        "# Visualize\n",
        "plt.figure(figsize=(10, 5))\n",
        "plt.subplot(1, 2, 1)\n",
        "churn_counts.plot(kind='bar', color=['green', 'red'])\n",
        "plt.title('Churn Distribution')\n",
        "plt.xlabel('Churn Status')\n",
        "plt.ylabel('Count')\n",
        "plt.xticks(rotation=0)\n",
        "\n",
        "plt.subplot(1, 2, 2)\n",
        "df['Churn'].value_counts().plot(kind='pie', autopct='%1.1f%%', colors=['green', 'red'])\n",
        "plt.title('Churn Percentage')\n",
        "plt.ylabel('')\n",
        "\n",
        "plt.tight_layout()\n",
        "plt.show()\n"
      ]
    }
  ],
  "metadata": {
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 2
}
