{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "25a4784b-3d3b-4870-bd32-83d32ec7d4de", "metadata": { "tags": [] }, "source": [ "# Uncovering Trends and Patterns in Raw World Happiness Data for Strategic Insights" ] }, { "attachments": {}, "cell_type": "markdown", "id": "693db1a6-6243-447a-90f3-3ddcbc180b0f", "metadata": { "tags": [] }, "source": [ "# Table of Contents" ] }, { "attachments": {}, "cell_type": "markdown", "id": "411b2289-d816-4c08-9fc9-08233887df4f", "metadata": {}, "source": [ "1. [Import Relevant Packages](#import)\n", "2. [Setup Notebook Configuration](#setup)\n", "3. [Load the Data Frames](#load)\n", "4. [Perform EDA (Exploratory Data Analysis)](#eda)\n", "5. [Cluster Our Data Frame](#cluster)\n", "6. [Feature (Column) Understanding](#feature)\n", "7. [Model Training and Evaluation](#model)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "e844e502-37e3-4cdc-9705-b927d798940c", "metadata": { "tags": [] }, "source": [ "\n", "## Import Relevant Packages:" ] }, { "cell_type": "code", "execution_count": 1, "id": "119db542-d7c3-47f8-83a1-be91de798c39", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).\n" ] } ], "source": [ "# Core Python libraries:\n", "import pandas as pd\n", "import numpy as np\n", "from typing import Union\n", "import re\n", "import os\n", "import certifi\n", "\n", "# Visiualization libraries:\n", "import mercury as mr\n", "import pygwalker as pyg\n", "from matplotlib import pyplot as plt\n", "from matplotlib_inline.backend_inline import set_matplotlib_formats\n", "import scienceplots\n", "import seaborn as sns\n", "from lets_plot import *\n", "from lets_plot.bistro import *\n", "from lets_plot.geo_data import *\n", "\n", "# Machine Learning and Numerical Processing libraries:\n", "from tqdm import tqdm\n", "from xgboost import XGBRegressor\n", "from sklearn.cluster import KMeans\n", "from sklearn.preprocessing import OneHotEncoder, StandardScaler, MinMaxScaler\n", "from sklearn.metrics import mean_squared_error, r2_score\n", "from sklearn.impute import SimpleImputer\n", "from sklearn.linear_model import LinearRegression\n", "from sklearn.ensemble import HistGradientBoostingClassifier, HistGradientBoostingRegressor, RandomForestRegressor\n", "from sklearn.model_selection import train_test_split, cross_validate, GridSearchCV" ] }, { "attachments": {}, "cell_type": "markdown", "id": "0aa27a00-5427-4f24-96b5-49d03cd045d7", "metadata": {}, "source": [ "\n", "## Setup Notebook Configuration:" ] }, { "cell_type": "code", "execution_count": 2, "id": "8c804105-d309-4216-a9eb-0b180c2a459b", "metadata": {}, "outputs": [ { "data": { "application/mercury+json": "{\n \"widget\": \"App\",\n \"title\": \"Uncovering Trends and Patterns in Raw World Happiness Data for Strategic Insights!\",\n \"description\": \"This notebook aims \\nto analyze and understand the factors influencing the happiness levels of countries worldwide, as reported in the World Happiness Report. \\nThrough a detailed examination of indicators and behaviors associated with happiness, we seek to unveil trends and patterns. \\nThe insights and visualizations derived from this data exploration and mining are designed to guide strategic decision-making for \\ngovernmental and non-governmental leaders interested in enhancing societal well-being. By leveraging this information, leadership \\ncan enact policies and initiatives that directly target areas with potential for improvement.\",\n \"show_code\": false,\n \"show_prompt\": false,\n \"output\": \"app\",\n \"schedule\": \"\",\n \"notify\": \"{}\",\n \"continuous_update\": true,\n \"static_notebook\": false,\n \"show_sidebar\": true,\n \"full_screen\": true,\n \"allow_download\": true,\n \"model_id\": \"mercury-app\",\n \"code_uid\": \"App.0.40.24.2-rand6bae532a\"\n}", "text/html": [ "