{ "cells": [ { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "#Import the libraries and packages we need\n", "import numpy as np\n", "from sklearn.linear_model import LinearRegression\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "#we are going to create two arrays that have our data. These should be the same length\n", "\n", "x = np.array([10,40,25,30,55,18,7]).reshape(-1,1) #we have to use reshape because we are required to pass in x \n", " #as a 2-dimensional array. One column and as many rows as necessary\n", "y = np.array([5,18,22,45,60,34,19])" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[10]\n", " [40]\n", " [25]\n", " [30]\n", " [55]\n", " [18]\n", " [ 7]]\n", "[ 5 18 22 45 60 34 19]\n" ] } ], "source": [ "print(x)\n", "print(y)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(7, 1)\n", "(7,)\n" ] } ], "source": [ "print(x.shape)\n", "print(y.shape)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "#we now create our model instance. We are just going to use the default parameters\n", "#we also are going to fit the model\n", "#this calculates the values for the slope and intercept in our regression equation\n", "model = LinearRegression().fit(x,y) " ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "r-squared: 0.5034536744482078\n" ] } ], "source": [ "#now we can see the results\n", "#first our r-squared\n", "r_sq = model.score(x,y)\n", "print(\"r-squared: \",r_sq)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "intercept: 8.420731707317064\n", "slope: [0.77867502]\n" ] } ], "source": [ "#we can also find our intercept and slope\n", "intercept = model.intercept_\n", "slope = model.coef_\n", "print(\"intercept: \",intercept)\n", "print(\"slope: \",slope)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "#now we can find our predicted values\n", "y_predicted = model.predict(x)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([16.20748187, 39.56773237, 27.88760712, 31.7809822 , 51.24785761,\n", " 22.436882 , 13.87145682])" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "y_predicted" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "#we can now create our regression equation\n", "y_predicted = intercept + slope*x" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlAAAAI/CAYAAAC4QOfKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAzuElEQVR4nO3dd3SVVfq38e8mBAg19F6lClIj0qUHwcI4ys82YkUdxzqiICoCFhTLWGbsBXtF7IQmTREIvUgRiECCBMQAQiBtv38QHwkvSh44J/uU67OWK7kfkpV7+Whyuc/J0VhrBQAAgMIr5noBAACAcENAAQAA+ERAAQAA+ERAAQAA+ERAAQAA+ERAAQAA+FS8KL9YlSpVbIMGDYrySwIAAJyQxYsX77LWVj3WnxVpQDVo0EDJyclF+SUBAABOiDHmpz/7Mx7CAwAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8ImAAgAA8KlQAWWMiTfGfGSMWWuM+cEY09kYU8kYM80YsyH/bcVgLwsAABAKCnsC9ZSkKdba5pLaSPpB0ghJM6y1TSTNyJ8BAACCZvLS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m9rbRtJbSUNMMZ0EvcpFN0i6YcjZu5RaOplrW17xEsXcJ8CjIA6CdbaOZJ2H3X5PEkT89+fKGlwUe6Egqy12621S/Lf36fD3/hri/sUUuxhv+WPsfl/WXGfQooxpo6kQZJePuIy9yg8cJ8CjIAKvOrW2u3S4R/ekqo53gf5jDENJLWTtEDcp5CT/9DQMknpkqZZa7lPoec/ku6UlHfENe5R6LGSphpjFhtjhuVf4z4FWHHXCwBFwRhTVtLHkm611u41xrheCUex1uZKamuMiZf0iTGmleOVcARjzNmS0q21i40xPR2vg7/W1VqbZoypJmmaMWat64UiESdQgbfDGFNTkvLfpjveJ+oZY2J1OJ7ettZOyr/MfQpR1toMSbN0+PmF3KfQ0VXSucaYFEnvSeptjHlL3KOQY61Ny3+bLukTSR3FfQo4AirwPpM0NP/9oZI+dbhL1DOHj5pekfSDtfaJI/6I+xRCjDFV80+eZIyJk9RX0lpxn0KGtXaktbaOtbaBpIskzbTWXibuUUgxxpQxxpT7/X1J/SWtEvcp4HghzZNgjHlXUk8d/r9c75A0WtJkSR9Iqidpi6QLrbVHP9EcRcQY003SXEkr9cfzNu7W4edBcZ9ChDGmtQ4/sTVGh//D7gNr7VhjTGVxn0JO/kN4d1hrz+YehRZjTCMdPnWSDj9N5x1r7YPcp8AjoAAAAHziITwAAACfCCgAAACfCCgAAACfCCgAAACfCCgAAACfCCgAAACfCCgAAACfCCgAAACf/h8L8X1oH/uvBAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "#now we can plot the \n", "fig,ax = plt.subplots(figsize=(10,10))\n", "plt.scatter(x,y)\n", "plt.plot(x,y_predicted)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.5" } }, "nbformat": 4, "nbformat_minor": 4 }