{ "cells": [ { "cell_type": "markdown", "id": "c63e966d", "metadata": {}, "source": [ "# Linear Regression" ] }, { "cell_type": "code", "execution_count": 1, "id": "05abcb9a", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "from sklearn import datasets, linear_model\n", "from sklearn.metrics import mean_squared_error, r2_score\n", "from sklearn.model_selection import train_test_split\n", "import pandas as pd\n", "sns.set_theme(font_scale=2,palette='colorblind')" ] }, { "cell_type": "markdown", "id": "0ccdb53f", "metadata": {}, "source": [ "## Setting upa linear regression" ] }, { "cell_type": "code", "execution_count": 2, "id": "1659e88e", "metadata": {}, "outputs": [], "source": [ "tips = sns.load_dataset(\"tips\")" ] }, { "cell_type": "code", "execution_count": 3, "id": "edcadada", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | total_bill | \n", "tip | \n", "sex | \n", "smoker | \n", "day | \n", "time | \n", "size | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "16.99 | \n", "1.01 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
LinearRegression()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
LinearRegression()
LinearRegression()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
LinearRegression()