{ "cells": [ { "cell_type": "markdown", "id": "1c2d7e40", "metadata": {}, "source": [ "(chapter6_part2)=\n", "\n", "# Search Methods\n", "\n", "- This is a supplement material for the [Machine Learning Simplified](https://themlsbook.com) book. It sheds light on Python implementations of the topics discussed while all detailed explanations can be found in the book. \n", "- I also assume you know Python syntax and how it works. If you don't, I highly recommend you to take a break and get introduced to the language before going forward with my code. \n", "- This material can be downloaded as a Jupyter notebook (Download button in the upper-right corner -> `.ipynb`) to reproduce the code and play around with it. \n", "\n", "\n", "## 1. Required Libraries, Data & Variables\n", "\n", "Let's import the data and have a look at it:" ] }, { "cell_type": "code", "execution_count": 1, "id": "d2e19676", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "data = pd.read_csv('https://github.com/5x12/themlsbook/raw/master/supplements/data/car_price.csv', delimiter=',', header=0)" ] }, { "cell_type": "code", "execution_count": 2, "id": "7d790fe7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | car_ID | \n", "symboling | \n", "CarName | \n", "fueltype | \n", "aspiration | \n", "doornumber | \n", "carbody | \n", "drivewheel | \n", "enginelocation | \n", "wheelbase | \n", "... | \n", "enginesize | \n", "fuelsystem | \n", "boreratio | \n", "stroke | \n", "compressionratio | \n", "horsepower | \n", "peakrpm | \n", "citympg | \n", "highwaympg | \n", "price | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1 | \n", "3 | \n", "alfa-romero giulia | \n", "gas | \n", "std | \n", "two | \n", "convertible | \n", "rwd | \n", "front | \n", "88.6 | \n", "... | \n", "130 | \n", "mpfi | \n", "3.47 | \n", "2.68 | \n", "9.0 | \n", "111 | \n", "5000 | \n", "21 | \n", "27 | \n", "13495.0 | \n", "
1 | \n", "2 | \n", "3 | \n", "alfa-romero stelvio | \n", "gas | \n", "std | \n", "two | \n", "convertible | \n", "rwd | \n", "front | \n", "88.6 | \n", "... | \n", "130 | \n", "mpfi | \n", "3.47 | \n", "2.68 | \n", "9.0 | \n", "111 | \n", "5000 | \n", "21 | \n", "27 | \n", "16500.0 | \n", "
2 | \n", "3 | \n", "1 | \n", "alfa-romero Quadrifoglio | \n", "gas | \n", "std | \n", "two | \n", "hatchback | \n", "rwd | \n", "front | \n", "94.5 | \n", "... | \n", "152 | \n", "mpfi | \n", "2.68 | \n", "3.47 | \n", "9.0 | \n", "154 | \n", "5000 | \n", "19 | \n", "26 | \n", "16500.0 | \n", "
3 | \n", "4 | \n", "2 | \n", "audi 100 ls | \n", "gas | \n", "std | \n", "four | \n", "sedan | \n", "fwd | \n", "front | \n", "99.8 | \n", "... | \n", "109 | \n", "mpfi | \n", "3.19 | \n", "3.40 | \n", "10.0 | \n", "102 | \n", "5500 | \n", "24 | \n", "30 | \n", "13950.0 | \n", "
4 | \n", "5 | \n", "2 | \n", "audi 100ls | \n", "gas | \n", "std | \n", "four | \n", "sedan | \n", "4wd | \n", "front | \n", "99.4 | \n", "... | \n", "136 | \n", "mpfi | \n", "3.19 | \n", "3.40 | \n", "8.0 | \n", "115 | \n", "5500 | \n", "18 | \n", "22 | \n", "17450.0 | \n", "
5 rows × 26 columns
\n", "