{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# **Lab - Model Evaluation and Refinement**\n",
"\n",
"ITM-370: Data Analytics
\n",
"**Lecturer: HAS Sothea, PhD**\n",
"\n",
"-------"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Objective:** Building a model is (SLR or MLR) is rather simple, but building a good model that can generalize well on unseen observations is more challenging. This practical lab aims at enhancing your practical skills in pushing the performance of your models on new unseen data using techniques introduced in the class.\n",
"\n",
"> **The `Jupyter Notebook` for this Lab can be downloaded here: [Lab_Model_Evaluation_Refinement.ipynb](https://hassothea.github.io/Data_Analytics_AUPP/Labs/Lab_Model_Evaluation_Refinement.ipynb)**.\n",
"\n",
"> **Or you can work with this notebook in `Google Colab` here: [Lab_Model_Evaluation_Refinement.ipynb](https://colab.research.google.com/drive/1olaCH9qshMuwVL3Lp-nqcB7F4nJswMYe?usp=sharing)**.\n",
"\n",
"-----------\n",
"\n",
"## 1. Importing `Abalone dataset`\n",
"\n",
"You need internet to load the data by running the following codes. For more information about this data, read [`Abalone dataset`](https://www.kaggle.com/datasets/rodolfomendes/abalone-dataset)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Path to dataset files: C:\\Users\\hasso\\.cache\\kagglehub\\datasets\\rodolfomendes\\abalone-dataset\\versions\\3\n"
]
},
{
"data": {
"text/html": [
"
\n", " | Sex | \n", "Length | \n", "Diameter | \n", "Height | \n", "Whole weight | \n", "Shucked weight | \n", "Viscera weight | \n", "Shell weight | \n", "Rings | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "M | \n", "0.455 | \n", "0.365 | \n", "0.095 | \n", "0.5140 | \n", "0.2245 | \n", "0.1010 | \n", "0.150 | \n", "15 | \n", "
1 | \n", "M | \n", "0.350 | \n", "0.265 | \n", "0.090 | \n", "0.2255 | \n", "0.0995 | \n", "0.0485 | \n", "0.070 | \n", "7 | \n", "
2 | \n", "F | \n", "0.530 | \n", "0.420 | \n", "0.135 | \n", "0.6770 | \n", "0.2565 | \n", "0.1415 | \n", "0.210 | \n", "9 | \n", "
3 | \n", "M | \n", "0.440 | \n", "0.365 | \n", "0.125 | \n", "0.5160 | \n", "0.2155 | \n", "0.1140 | \n", "0.155 | \n", "10 | \n", "
4 | \n", "I | \n", "0.330 | \n", "0.255 | \n", "0.080 | \n", "0.2050 | \n", "0.0895 | \n", "0.0395 | \n", "0.055 | \n", "7 | \n", "