{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Data Science Projects & Interview Questions (With Source Code)\n",
        "Practice notebook for the Xenors lesson: https://xenors.in/data-science/data-science-projects-interview-prep/\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "df = pd.read_csv('../datasets/data-science-projects-interview-prep.csv')\n",
        "df.head()\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Baseline example\n",
        "Expected checkpoint: Run the cell and inspect the printed values before changing anything.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "project/\n",
        "\u251c\u2500\u2500 README.md\n",
        "\u251c\u2500\u2500 data/\n",
        "\u251c\u2500\u2500 notebooks/01_eda.ipynb\n",
        "\u251c\u2500\u2500 src/features.py\n",
        "\u251c\u2500\u2500 src/train.py\n",
        "\u251c\u2500\u2500 tests/\n",
        "\u2514\u2500\u2500 requirements.txt\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Create a project checklist in Python\n",
        "Expected checkpoint: 1. problem statement\n2. data audit\n3. baseline\n4. evaluation\n5. error analysis\n6. README\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "steps=['problem statement','data audit','baseline','evaluation','error analysis','README']\n",
        "for i,step in enumerate(steps,1):\n",
        "    print(f'{i}. {step}')\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Record experiment results\n",
        "Expected checkpoint: run       metric note\nbaseline   0.61  simple reference\nmodel_v2   0.68  added validated features\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "results=pd.DataFrame([\n",
        " {'run':'baseline','metric':0.61,'note':'simple reference'},\n",
        " {'run':'model_v2','metric':0.68,'note':'added validated features'}\n",
        "])\n",
        "print(results.to_string(index=False))\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Write a reproducibility manifest\n",
        "Expected checkpoint: The manifest records the inputs and assumptions another person needs to reproduce the work.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "manifest={\n",
        " 'data':'practice.csv',\n",
        " 'seed':42,\n",
        " 'metric':'documented in README',\n",
        " 'limitations':['sample size','possible drift']\n",
        "}\n",
        "print(manifest)\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Turn findings into a concise interview story\n",
        "Expected checkpoint: A four-part structure appears that can be adapted to a real project answer.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "story={\n",
        " 'problem':'What decision was needed?',\n",
        " 'action':'What did you test and why?',\n",
        " 'result':'What changed after validation?',\n",
        " 'lesson':'What would you do differently?'\n",
        "}\n",
        "for k,v in story.items(): print(k.title()+':',v)\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.x"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}