Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Developing a model to create Correlation Heatmap #2323

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 329 additions & 0 deletions Matplotlib/Matplotlib_Correlation_Heatmap.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,329 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "cab73e9a-9e42-45dd-91cb-8d7d203d734c",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T17:37:56.670971Z",
"iopub.status.busy": "2023-10-16T17:37:56.670500Z",
"iopub.status.idle": "2023-10-16T17:37:56.681790Z",
"shell.execute_reply": "2023-10-16T17:37:56.680945Z",
"shell.execute_reply.started": "2023-10-16T17:37:56.670886Z"
},
"tags": []
},
"source": [
"![Naas](https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160)\n"
]
},
{
"cell_type": "markdown",
"id": "edb9d0c3-fd59-4e5b-b86f-4612069d386c",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T17:41:03.383023Z",
"iopub.status.busy": "2023-10-16T17:41:03.382701Z",
"iopub.status.idle": "2023-10-16T17:41:03.402250Z",
"shell.execute_reply": "2023-10-16T17:41:03.401286Z",
"shell.execute_reply.started": "2023-10-16T17:41:03.382985Z"
},
"tags": []
},
"source": [
"# Matplotlib- Correlation Heatmap\n",
"[![Open in Naas Lab](https://naasai-public.s3.eu-west-3.amazonaws.com/Open_in_Naas_Lab.svg)](https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/HubSpot/HubSpot_Delete_Task.ipynb)\n",
"\n",
"[Give Feedback](https://bit.ly/3JyWIk6) | [Bug report](https://github.com/jupyter-naas/awesome-notebooks/issues/new?assignees=&labels=bug&template=bug_report.md&title=HubSpot+-+Delete+Task:+Error+short+description)\n"
]
},
{
"cell_type": "markdown",
"id": "2881fa65-31d4-48ec-b7ec-33feace608e2",
"metadata": {},
"source": [
"**Tags:** #matplotlib #correlation #heatmap #dataviz #snippet"
]
},
{
"cell_type": "markdown",
"id": "4c18d244-aeab-406a-9f1a-450f9cfa51f3",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T17:43:00.717079Z",
"iopub.status.busy": "2023-10-16T17:43:00.716824Z",
"iopub.status.idle": "2023-10-16T17:43:00.727560Z",
"shell.execute_reply": "2023-10-16T17:43:00.726568Z",
"shell.execute_reply.started": "2023-10-16T17:43:00.717042Z"
}
},
"source": [
"**Author:** [Rittika Deb](https://www.linkedin.com/in/rittika-deb/)"
]
},
{
"cell_type": "markdown",
"id": "d758e605-8691-42d0-bbea-154cb64a83ef",
"metadata": {},
"source": [
"**Last update:** 2023-10-17 (Created: 2023-10-17)"
]
},
{
"cell_type": "markdown",
"id": "c357d9d5-7473-467f-82f7-535c71bda7f7",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T17:53:17.127826Z",
"iopub.status.busy": "2023-10-16T17:53:17.127606Z",
"iopub.status.idle": "2023-10-16T17:53:17.137291Z",
"shell.execute_reply": "2023-10-16T17:53:17.136412Z",
"shell.execute_reply.started": "2023-10-16T17:53:17.127802Z"
}
},
"source": [
"**Description:** This template will create a correlation heatmap. "
]
},
{
"cell_type": "markdown",
"id": "a985c7d5-e713-4df4-a5cc-a7e07f28b45d",
"metadata": {},
"source": [
"## Input"
]
},
{
"cell_type": "markdown",
"id": "053efcee-5abc-4261-9c3f-9b07335fce37",
"metadata": {},
"source": [
"### Import libraries"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "997f305a-2f31-43e9-8be6-4e9ca18a42f9",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T19:25:41.296145Z",
"iopub.status.busy": "2023-10-16T19:25:41.295809Z",
"iopub.status.idle": "2023-10-16T19:25:41.299904Z",
"shell.execute_reply": "2023-10-16T19:25:41.299232Z",
"shell.execute_reply.started": "2023-10-16T19:25:41.296105Z"
},
"tags": []
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"id": "1c8863f9-7485-4249-9355-ccba68b273d6",
"metadata": {},
"source": [
"### Setup Variables\n",
"- `data`: An array representing an 8x8 grid of data points.\n",
"- `xlabs and ylabs`: Lists of strings that label the rows and columns of the heatmap.\n",
"- `fig`: Top-level container that holds everything in the figure.\n",
"- `ax`: Axis object where you can plot your data.\n",
"- `heatmap`: Actual heatmap representation of the data.\n",
"- `ax.set_xticks and ax.set_yticks`: To set the tick positions along the x and y axes, respectively. \n",
"- `ax.set_xticklabels and ax.set_yticklabels`: These methods set the tick labels for the x and y axes, respectively.\n",
"- `plt.colorbar(heatmap)`: Adds a colorbar to the heatmap to indicate the color mapping of values."
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "cbf14455-b245-4837-a17d-46a6863f6543",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T19:25:44.835351Z",
"iopub.status.busy": "2023-10-16T19:25:44.835120Z",
"iopub.status.idle": "2023-10-16T19:25:44.838820Z",
"shell.execute_reply": "2023-10-16T19:25:44.838198Z",
"shell.execute_reply.started": "2023-10-16T19:25:44.835327Z"
},
"tags": []
},
"outputs": [],
"source": [
"data = {\n",
" 'A': np.random.rand(100),\n",
" 'B': np.random.rand(100),\n",
" 'C': np.random.rand(100),\n",
" 'D': np.random.rand(100)\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "ba4aa346-3ac0-4529-b897-33a2e5b00a96",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T19:25:48.030371Z",
"iopub.status.busy": "2023-10-16T19:25:48.030146Z",
"iopub.status.idle": "2023-10-16T19:25:48.036872Z",
"shell.execute_reply": "2023-10-16T19:25:48.036321Z",
"shell.execute_reply.started": "2023-10-16T19:25:48.030348Z"
},
"tags": []
},
"outputs": [],
"source": [
"df = pd.DataFrame(data)"
]
},
{
"cell_type": "markdown",
"id": "5a38219b-cc92-47c2-a6ce-0e46c52da4e1",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T19:12:24.550584Z",
"iopub.status.busy": "2023-10-16T19:12:24.550358Z",
"iopub.status.idle": "2023-10-16T19:12:24.553470Z",
"shell.execute_reply": "2023-10-16T19:12:24.552819Z",
"shell.execute_reply.started": "2023-10-16T19:12:24.550561Z"
}
},
"source": [
"## Model"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "a3efb78f-8124-4393-a883-473d2743296a",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T19:25:49.435376Z",
"iopub.status.busy": "2023-10-16T19:25:49.435155Z",
"iopub.status.idle": "2023-10-16T19:25:49.439089Z",
"shell.execute_reply": "2023-10-16T19:25:49.438391Z",
"shell.execute_reply.started": "2023-10-16T19:25:49.435353Z"
},
"tags": []
},
"outputs": [],
"source": [
"correlation_matrix = df.corr()"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "d7d33bc4-e1b4-4d8e-b4d4-0d1e78f45d5d",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T19:25:50.061146Z",
"iopub.status.busy": "2023-10-16T19:25:50.060595Z",
"iopub.status.idle": "2023-10-16T19:25:50.068156Z",
"shell.execute_reply": "2023-10-16T19:25:50.067487Z",
"shell.execute_reply.started": "2023-10-16T19:25:50.061109Z"
},
"tags": []
},
"outputs": [],
"source": [
"xlabs = correlation_matrix.columns\n",
"ylabs = correlation_matrix.index"
]
},
{
"cell_type": "markdown",
"id": "2f83319a-99d3-4b17-aedf-c1f923d8b904",
"metadata": {},
"source": [
"## Output"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5ebe3d71-a044-4fed-8d3d-a6bd7bc67a02",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-16T19:25:53.050436Z",
"iopub.status.busy": "2023-10-16T19:25:53.050214Z",
"iopub.status.idle": "2023-10-16T19:25:53.231261Z",
"shell.execute_reply": "2023-10-16T19:25:53.230644Z",
"shell.execute_reply.started": "2023-10-16T19:25:53.050413Z"
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"([<matplotlib.axis.YTick at 0x7f664b842730>,\n",
" <matplotlib.axis.YTick at 0x7f664b842490>,\n",
" <matplotlib.axis.YTick at 0x7f664b8eabe0>,\n",
" <matplotlib.axis.YTick at 0x7f664b9df160>],\n",
" [Text(0, 0, 'A'), Text(0, 1, 'B'), Text(0, 2, 'C'), Text(0, 3, 'D')])"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAb8AAAFzCAYAAACuOQe9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZ4klEQVR4nO3de9RldX3f8fdnHu5yz4CX4RodjYTE2xRi0eA1gu1yTGsMY6jSqvNHQtpoYjTVhS40ITevkcSMDUElSpRGO21HMYmyrK0aBuMNGuwEgwwqMojSKqjDfPvH2SOHh3mec56znzPn2c9+v9baa87e+3d+53fOsPjO93fbqSokSeqTNbNugCRJ+5vBT5LUOwY/SVLvGPwkSb1j8JMk9Y7BT5LUOwY/dUaSC5J8ssX7P5zkRcvZJkndZPDTkiR5QZLtSf5fkq83AeVJs27XfElel+SK4WtVdW5VvWsKn3V5kjfMu3ZKkkpywDLUf02Sl7StR9J9DH4aW5KXA28Bfgd4MHAS8MfAxgnqekBQWI5AIUnjMPhpLEmOAi4GfqWq/qqqvltVP6yq/1pVr2jKHJzkLUm+1hxvSXJwc+8pSXYmeWWSbwB/3mRnVyW5IsldwAVJjkryZ01WeWuSNySZW6B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7xIknpnvKexrzQGP0lSK12c8OKYnySpd8z8JEmTc52fJKlviurkhJeMeN7f5BUntwM3T6Xy6VkL7Jp1I1Y5f+Pp8zeevi7+xidX1XHLXWmSjzD4PdrYVVXnLEd7xjW14NdFSbZX1YZZt2M18zeePn/j6fM37j4nvEiSesfgJ0nqHYPf/W2ZdQN6wN94+vyNp8/fuOMc85Mk9Y6ZnySpdwx+kqTeMfgNSfKkJJfOuh3SuJI8IslZ+7h+VpKHz6JNUhf0PvgleVySP0jyT8DrgX+YcZNWtSRrk2TW7VhF3gLctY/rdzX3tIySHJdk2ReKa//rZfBL8sgkr03yD8AfAV9lMPnnqVX1RzNu3qqR5GeSXJPkr5p/ZHwJ+BJwW5L9upvDKvbgqvri/IvNtVP2f3NWnwy8Lsku4Ebgy0luT3LRrNumyfUy+DHI7p4G/MuqelIT8O6dcZtWo7cDvwO8D/gY8JKqegjws8Als2zYKnL0IvcO3V+NWOVeBpwF/LOqOraqjgHOBM5K8rLZNk2T6mvw+1fA14GPJ3lnkqcDdsUtvwOq6qNV9QHgG1X1aYCqsmt5+WxP8tL5F5O8BLhuBu1Zjf4NsKmqvrL3QlXdBJwPvHBmrVIrvXyqQ1V9CPhQkgcBG4FfA45P8ifAB6vqozNs3moyvNX73fPuucB0efwa8MEkv8R9wW4DcBDw87Nq1CpzYFU9YBPrqro9yYGzaJDac5F7I8kxwC8Av1hVT591e1aDJPcC32WQVR8KfG/vLeCQqvJ/HMskyVOB05vT66vqY7Nsz2qS5LNV9fil3tPKZvCTpEUM/SPuAbfwH3GdZfCTJPVOXye8SJJ6zOAnSeodg58kqXcMfpKk3jH4SZJ65/8D2eir0c86e2wAAAAASUVORK5CYII=",
"text/plain": [
"<Figure size 576x432 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(8, 6))\n",
"plt.imshow(correlation_matrix, cmap='coolwarm', interpolation='none', aspect='auto')\n",
"plt.colorbar()\n",
"plt.title('Correlation Heatmap')\n",
"plt.xticks(np.arange(len(xlabs)), xlabs, rotation=90)\n",
"plt.yticks(np.arange(len(ylabs)), ylabs)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fcc3af40",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading