{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Topic 25: Practice\n",
    "\n",
    "Asiman Data School, Module 3: Comprehensive Machine Learning. Week 13, Tuesday.\n",
    "\n",
    "Fourteen problems in three levels, on the same ideas and at the same level as the lesson notebook. They are numbered 5 to 18, as on the lesson page, where Problems 1 to 4 are solved by hand.\n",
    "\n",
    "How to work\n",
    "\n",
    "- Write your code in the cell under each problem and run it with Shift + Enter. Print exactly what the problem asks for.\n",
    "- A hint and one possible solution are under each problem. Open them only after you have tried.\n",
    "- The problems are the steps of one project: every cell uses what the cells above it created, so work from top to bottom.\n",
    "- The file phones.csv must be in the same folder as this notebook. On the Asiman Data School website it is already there.\n",
    "\n",
    "Tip: Only what your code prints is compared with the expected output, so any code that prints the same text is right. Use the names the steps give (`df`, `upper`, `train`, `test`, `features`, `X_train`, `scaler`, `X_train_scaled`, `model`): the later steps run after your own answers to the earlier ones, so solve them in order."
   ],
   "id": "t25p-000"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Steps 5 to 9: the columns and the outliers"
   ],
   "id": "t25p-001"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 5. Read and drop\n",
    "\n",
    "Read `phones.csv` into `df` and drop the columns `phone_id`, `seller_name` and `currency`. Print the shape of the table."
   ],
   "id": "t25p-002"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "# Write your code here"
   ],
   "id": "t25p-003"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`df = pd.read_csv(\"phones.csv\")`, `df = df.drop(columns=[\"phone_id\", \"seller_name\", \"currency\"])`, then `print(df.shape)`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "import pandas as pd\n",
    "\n",
    "df = pd.read_csv(\"phones.csv\")\n",
    "df = df.drop(columns=[\"phone_id\", \"seller_name\", \"currency\"])\n",
    "\n",
    "print(df.shape)\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "(260, 12)\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-004"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 6. The IQR rule\n",
    "\n",
    "Calculate the upper limit of the IQR rule for `price` into the variable `upper`. Print the limit, then the number of prices above it. This step continues from Step 5."
   ],
   "id": "t25p-005"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-006"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`q1 = df[\"price\"].quantile(0.25)`, the same with `0.75` for `q3`, then `upper = q3 + 1.5 * (q3 - q1)`. The number of prices above it is `(df[\"price\"] > upper).sum()`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "q1 = df[\"price\"].quantile(0.25)\n",
    "q3 = df[\"price\"].quantile(0.75)\n",
    "upper = q3 + 1.5 * (q3 - q1)\n",
    "\n",
    "print(upper)\n",
    "print((df[\"price\"] > upper).sum())\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "1855.0\n",
    "5\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-007"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 7. The z-score\n",
    "\n",
    "Calculate the z-scores of `price` and print the prices with a z-score above 3 as a sorted list. This step continues from Step 5."
   ],
   "id": "t25p-008"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-009"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`z = (df[\"price\"] - df[\"price\"].mean()) / df[\"price\"].std()`, then `print(df[z > 3][\"price\"].sort_values().tolist())`. Each of these prices is about ten times the price of an ordinary phone: typing mistakes.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "z = (df[\"price\"] - df[\"price\"].mean()) / df[\"price\"].std()\n",
    "\n",
    "print(df[z > 3][\"price\"].sort_values().tolist())\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "[6040, 9900, 10560, 10920, 13880]\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-010"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 8. Remove the wrong prices\n",
    "\n",
    "Remove the rows whose price lies above `upper`. Print the shape of the table, then the largest price that is left. This step continues from Step 6."
   ],
   "id": "t25p-011"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-012"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`df = df[df[\"price\"] <= upper]`, then `print(df.shape)` and `print(df[\"price\"].max())`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "df = df[df[\"price\"] <= upper]\n",
    "\n",
    "print(df.shape)\n",
    "print(df[\"price\"].max())\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "(255, 12)\n",
    "1770\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-013"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 9. Repair the weights\n",
    "\n",
    "Some weights were typed in kilograms (0.19 where 190 was meant). Print how many values of `weight_g` are below 10. Then multiply these values by 1,000 and print the smallest weight. This step continues from Step 8."
   ],
   "id": "t25p-014"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-015"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`print((df[\"weight_g\"] < 10).sum())`, then `df.loc[df[\"weight_g\"] < 10, \"weight_g\"] = df[\"weight_g\"] * 1000` and `print(df[\"weight_g\"].min())`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "print((df[\"weight_g\"] < 10).sum())\n",
    "\n",
    "df.loc[df[\"weight_g\"] < 10, \"weight_g\"] = df[\"weight_g\"] * 1000\n",
    "\n",
    "print(df[\"weight_g\"].min())\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "5\n",
    "120.0\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-016"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Steps 10 to 14: encode, split, select"
   ],
   "id": "t25p-017"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 10. Two values and an order\n",
    "\n",
    "Encode `dual_sim` as 0 (no) and 1 (yes), and `condition` in its order: used 0, good 1, like new 2, new 3. Print the first three rows of the two columns. This step continues from Step 9."
   ],
   "id": "t25p-018"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-019"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`df[\"dual_sim\"] = df[\"dual_sim\"].map({\"no\": 0, \"yes\": 1})`, a second dictionary for `condition`, then `print(df[[\"dual_sim\", \"condition\"]].head(3))`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "df[\"dual_sim\"] = df[\"dual_sim\"].map({\"no\": 0, \"yes\": 1})\n",
    "df[\"condition\"] = df[\"condition\"].map({\"used\": 0, \"good\": 1, \"like new\": 2, \"new\": 3})\n",
    "\n",
    "print(df[[\"dual_sim\", \"condition\"]].head(3))\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "   dual_sim  condition\n",
    "0         0          1\n",
    "1         1          0\n",
    "2         0          0\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-020"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 11. One-hot encoding\n",
    "\n",
    "One-hot encode `material` inside the table, with `drop_first=True` and `dtype=int`. Print the names of the columns as a list. This step continues from Step 10."
   ],
   "id": "t25p-021"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-022"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`df = pd.get_dummies(df, columns=[\"material\"], drop_first=True, dtype=int)`, then `print(df.columns.tolist())`. The first material in the order of the alphabet, `glass`, becomes the reference.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "df = pd.get_dummies(df, columns=[\"material\"], drop_first=True, dtype=int)\n",
    "\n",
    "print(df.columns.tolist())\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "['brand', 'condition', 'dual_sim', 'ram_gb', 'storage_gb', 'screen_inch', 'screen_cm', 'weight_g', 'camera_mp', 'age_months', 'price', 'material_metal', 'material_plastic']\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-023"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 12. Split the table\n",
    "\n",
    "Split `df` into `train` and `test` with `test_size=0.25` and `random_state=7`, and make each of them a copy. Print the two shapes on one line. This step continues from Step 11."
   ],
   "id": "t25p-024"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-025"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`from sklearn.model_selection import train_test_split`, then `train, test = train_test_split(df, test_size=0.25, random_state=7)`, `train = train.copy()` and `test = test.copy()`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "train, test = train_test_split(df, test_size=0.25, random_state=7)\n",
    "train = train.copy()\n",
    "test = test.copy()\n",
    "\n",
    "print(train.shape, test.shape)\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "(191, 13) (64, 13)\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-026"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 13. Target encoding\n",
    "\n",
    "Target-encode `brand` into a new column `brand_price` in `train` and `test`, with the mean prices of `train`. Then drop `brand` from both tables. Print the mean prices of the brands, rounded to whole numbers. This step continues from Step 12."
   ],
   "id": "t25p-027"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-028"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`brand_means = train.groupby(\"brand\")[\"price\"].mean()`, then `train[\"brand_price\"] = train[\"brand\"].map(brand_means)` and the same for `test` (a gap in `test` is filled with `.fillna(train[\"price\"].mean())`). Drop with `train = train.drop(columns=[\"brand\"])`. Print `brand_means.round(0)`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "brand_means = train.groupby(\"brand\")[\"price\"].mean()\n",
    "\n",
    "train[\"brand_price\"] = train[\"brand\"].map(brand_means)\n",
    "test[\"brand_price\"] = test[\"brand\"].map(brand_means).fillna(train[\"price\"].mean())\n",
    "\n",
    "train = train.drop(columns=[\"brand\"])\n",
    "test = test.drop(columns=[\"brand\"])\n",
    "\n",
    "print(brand_means.round(0))\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "brand\n",
    "Arvo     977.0\n",
    "Brio    1317.0\n",
    "Celo     838.0\n",
    "Dexa    1167.0\n",
    "Elan    1435.0\n",
    "Fyra     955.0\n",
    "Gemo    1159.0\n",
    "Hilo     753.0\n",
    "Isto    1169.0\n",
    "Jolt    1212.0\n",
    "Name: price, dtype: float64\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-029"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 14. Correlations with the price\n",
    "\n",
    "Print the correlation of every column of `train` with `price`, rounded to 2 decimals. Which column has the weakest correlation, and which two say the same? This step continues from Step 13."
   ],
   "id": "t25p-030"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-031"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`print(train.corr()[\"price\"].round(2))`. `camera_mp` has the weakest correlation; `screen_inch` and `screen_cm` are one measurement in two units. Both `camera_mp` and `screen_cm` are left out in the next step.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "print(train.corr()[\"price\"].round(2))\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "condition           0.27\n",
    "dual_sim            0.14\n",
    "ram_gb              0.33\n",
    "storage_gb          0.29\n",
    "screen_inch        -0.14\n",
    "screen_cm          -0.14\n",
    "weight_g           -0.24\n",
    "camera_mp           0.10\n",
    "age_months         -0.37\n",
    "price               1.00\n",
    "material_metal      0.38\n",
    "material_plastic   -0.31\n",
    "brand_price         0.65\n",
    "Name: price, dtype: float64\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-032"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Steps 15 to 18: scale, train, read"
   ],
   "id": "t25p-033"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 15. Features and target\n",
    "\n",
    "The list `features` is in the editor. Make `X_train` and `X_test` from these columns of `train` and `test`, and `y_train` and `y_test` from `price`. Print the shapes of `X_train` and `X_test` on one line. This step continues from Step 13."
   ],
   "id": "t25p-034"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "features = [\"ram_gb\", \"storage_gb\", \"screen_inch\", \"weight_g\", \"age_months\", \"condition\", \"dual_sim\", \"material_metal\", \"material_plastic\", \"brand_price\"]\n",
    "\n",
    "# Write your code here"
   ],
   "id": "t25p-035"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`X_train = train[features]` and `y_train = train[\"price\"]`, and the same for `test`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "features = [\"ram_gb\", \"storage_gb\", \"screen_inch\", \"weight_g\", \"age_months\", \"condition\", \"dual_sim\", \"material_metal\", \"material_plastic\", \"brand_price\"]\n",
    "\n",
    "X_train = train[features]\n",
    "X_test = test[features]\n",
    "y_train = train[\"price\"]\n",
    "y_test = test[\"price\"]\n",
    "\n",
    "print(X_train.shape, X_test.shape)\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "(191, 10) (64, 10)\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-036"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 16. Scale after the split\n",
    "\n",
    "Scale the features with a `StandardScaler` called `scaler` into `X_train_scaled` and `X_test_scaled`. Print the column means of `X_test_scaled`, rounded to 2 decimals. This step continues from Step 15."
   ],
   "id": "t25p-037"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-038"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`from sklearn.preprocessing import StandardScaler`, then `scaler.fit_transform(X_train)` for the training data and `scaler.transform(X_test)` for the test data. The means are `.mean(axis=0).round(2)`: close to 0, not exactly 0. If your numbers differ, check `test_size=0.25` and `random_state=7` in Step 12.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "scaler = StandardScaler()\n",
    "X_train_scaled = scaler.fit_transform(X_train)\n",
    "X_test_scaled = scaler.transform(X_test)\n",
    "\n",
    "print(X_test_scaled.mean(axis=0).round(2))\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "[ 0.02  0.04 -0.11  0.02 -0.05 -0.28 -0.04  0.1   0.1  -0.04]\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-039"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 17. Train and judge\n",
    "\n",
    "Train a `LinearRegression` called `model` on the scaled training data. Print the training score, then the test score, each rounded to 3 decimals. This step continues from Step 16."
   ],
   "id": "t25p-040"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-041"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`from sklearn.linear_model import LinearRegression`, `model.fit(X_train_scaled, y_train)`, then `model.score(X_train_scaled, y_train)` and `model.score(X_test_scaled, y_test)`.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "model = LinearRegression()\n",
    "model.fit(X_train_scaled, y_train)\n",
    "\n",
    "print(round(model.score(X_train_scaled, y_train), 3))\n",
    "print(round(model.score(X_test_scaled, y_test), 3))\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "0.946\n",
    "0.947\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-042"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problem 18. Read the weights\n",
    "\n",
    "Print the weight of every feature next to its name, rounded to 1 decimal, one feature on a line. Which feature has the largest effect? This step continues from Step 17."
   ],
   "id": "t25p-043"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Write your code here"
   ],
   "id": "t25p-044"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<details>\n",
    "<summary><b>Show a hint</b></summary>\n",
    "\n",
    "`for name, weight in zip(features, model.coef_):` and inside the loop `print(name, round(weight, 1))`. The features were standardised, so the weight furthest from 0 has the largest effect.\n",
    "\n",
    "</details>\n",
    "\n",
    "<details>\n",
    "<summary><b>Show the solution</b></summary>\n",
    "\n",
    "```python\n",
    "for name, weight in zip(features, model.coef_):\n",
    "    print(name, round(weight, 1))\n",
    "```\n",
    "\n",
    "**Output**\n",
    "\n",
    "```\n",
    "ram_gb 95.8\n",
    "storage_gb 92.0\n",
    "screen_inch 7.8\n",
    "weight_g -19.2\n",
    "age_months -78.9\n",
    "condition 88.2\n",
    "dual_sim 34.0\n",
    "material_metal 39.3\n",
    "material_plastic -71.6\n",
    "brand_price 166.0\n",
    "```\n",
    "\n",
    "</details>"
   ],
   "id": "t25p-045"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you have finished, compare your solutions with the hidden ones. A different solution that prints the same numbers is just as good."
   ],
   "id": "t25p-046"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
