{ "metadata": { "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.3-final" }, "orig_nbformat": 2, "kernelspec": { "name": "python3", "display_name": "Python 3", "language": "python" } }, "nbformat": 4, "nbformat_minor": 2, "cells": [ { "source": [ "## Linear Regression for North American Pumpkins - Lesson 1" ], "cell_type": "markdown", "metadata": {} }, { "source": [ "Import needed libraries" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from sklearn import datasets, linear_model, model_selection\n" ] }, { "source": [ "Load the diabetes dataset, divided into `X` data and `y` features" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "(442, 10)\n[ 0.03807591 0.05068012 0.06169621 0.02187235 -0.0442235 -0.03482076\n -0.04340085 -0.00259226 0.01990842 -0.01764613]\n" ] } ], "source": [ "X, y = datasets.load_diabetes(return_X_y=True)\n", "print(X.shape)\n", "print(X[0])" ] }, { "source": [ "Select just one feature to target for this exercise" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "X = X[:, np.newaxis, 2]\n" ] }, { "source": [ "Split the training and test data for both `X` and `y`" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.33)\n" ] }, { "source": [ "Select the model and fit it with the training data" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "LinearRegression()" ] }, "metadata": {}, "execution_count": 5 } ], "source": [ "model = linear_model.LinearRegression()\n", "model.fit(X_train, y_train)" ] }, { "source": [ "Use test data to predict a line" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "y_pred = model.predict(X_test)\n" ] }, { "source": [ "Display the results in a plot" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "output_type": "display_data", "data": { "text/plain": "
", "image/svg+xml": "\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n", "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAA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7saY+caYW4wxm52/81z2u9IYs8MYc18zx2eBBq7FXxljNhljthhjVtSsv9AY84gxZp2znJac9dHgVrea7cYY801n+73GmGODHps1Ql6LsjFmg3MfZH6K1QDX4lXGmDuNMfuMMec1cmzL4PYWj7gWYCWwwvm8ArjYZb9TgGOB+5o5PgtLkLoA7cBW4GVAB7AeWOpsuxA4L+16hKi/a91q9jkNuBEwwAnAb4Mem6UlzLVwtpWBBWnXI8FrsQh4IzBQ+xvI230RZkkjLHM6sMr5vAo4o95OIvJrYHezx2eEIHU5HtgiIg+KyHPANc5xeSBI3U4HVkuVu4CXGGMWBzw2S4S5FnnD91qIyA4R+R2wv9FjW4U0xP0wEdkO4PxdlPDxNhGkLkuAh2v+3+asm+Jcp4t+ZQZDVH5189onyLFZIsy1gOr7aG82xqw1xvTFZmUyhPlu83ZfNM1BcRRqjPkF8NI6m0pxnM9mIrgWps66qfzVy4AvOv9/Efgq8LFGbUwRr7r57RPk2CwR5loAnCQijxpjFgG3GGP+4PR+s0iY7zZv90XTxCLuInKq2zZjzB+NMYtFZLvTpdzRYPFhj0+UCK7FNuDImv+PAB51yv5jTVmXAz+LxurEcK1bgH06AhybJcJcC0Rk6u8OY8yPqYYnsiruQa5FHMfmijTCMtcDy5zPy4DrEj7eJoLU5XfAy40xRxljOoAzneOYEW99L3BfneNtxrVuNVwPfMTJFDkBeNIJYQU5Nks0fS2MMXONMS8CMMbMBd5B9u6FWsJ8t3m7L5on6RFcoAtYA2x2/s531h8O3FCz39XAdqoDJtuAj3sdn8WlgWtxGvAA1SyAUs36q4ANwL1Ub+DFadepiWswq27AOcA5zmcDfMvZvgHo9bsuWV2avRZUM0PWO8vGFrkWL3V04Slgj/P5xXm8L5pddPoBRVGUHKJPqCqKouQQFXdFUZQcouKuKIqSQ1TcFUVRcoiKu6IoSg5RcVcURckhKu6Koig55P8DpS3whA4swa4AAAAASUVORK5CYII=\n" }, "metadata": { "needs_background": "light" } } ], "source": [ "plt.scatter(X_test, y_test, color='black')\n", "plt.plot(X_test, y_pred, color='blue', linewidth=3)\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ] }