{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "___\n", "\n", " \n", "___\n", "# Linear Regression - Project Exercise\n", "\n", "Congratulations! You just got some contract work with an Ecommerce company based in New York City that sells clothing online but they also have in-store style and clothing advice sessions. Customers come in to the store, have sessions/meetings with a personal stylist, then they can go home and order either on a mobile app or website for the clothes they want.\n", "\n", "The company is trying to decide whether to focus their efforts on their mobile app experience or their website. They've hired you on contract to help them figure it out! Let's get started!\n", "\n", "Just follow the steps below to analyze the customer data (it's fake, don't worry I didn't give you real credit card numbers or emails)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Imports\n", "** Import pandas, numpy, matplotlib,and seaborn. Then set %matplotlib inline \n", "(You'll import sklearn as you need it.)**" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Get the Data\n", "\n", "We'll work with the Ecommerce Customers csv file from the company. It has Customer info, suchas Email, Address, and their color Avatar. Then it also has numerical value columns:\n", "\n", "* Avg. Session Length: Average session of in-store style advice sessions.\n", "* Time on App: Average time spent on App in minutes\n", "* Time on Website: Average time spent on Website in minutes\n", "* Length of Membership: How many years the customer has been a member. \n", "\n", "** Read in the Ecommerce Customers csv file as a DataFrame called customers.**" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "cust=pd.read_csv('Ecommerce Customers')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Check the head of customers, and check out its info() and describe() methods.**" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Address | \n", "Avatar | \n", "Avg. Session Length | \n", "Time on App | \n", "Time on Website | \n", "Length of Membership | \n", "Yearly Amount Spent | \n", "|
---|---|---|---|---|---|---|---|---|
0 | \n", "mstephenson@fernandez.com | \n", "835 Frank Tunnel\\nWrightmouth, MI 82180-9605 | \n", "Violet | \n", "34.497268 | \n", "12.655651 | \n", "39.577668 | \n", "4.082621 | \n", "587.951054 | \n", "
1 | \n", "hduke@hotmail.com | \n", "4547 Archer Common\\nDiazchester, CA 06566-8576 | \n", "DarkGreen | \n", "31.926272 | \n", "11.109461 | \n", "37.268959 | \n", "2.664034 | \n", "392.204933 | \n", "
2 | \n", "pallen@yahoo.com | \n", "24645 Valerie Unions Suite 582\\nCobbborough, D... | \n", "Bisque | \n", "33.000915 | \n", "11.330278 | \n", "37.110597 | \n", "4.104543 | \n", "487.547505 | \n", "
3 | \n", "riverarebecca@gmail.com | \n", "1414 David Throughway\\nPort Jason, OH 22070-1220 | \n", "SaddleBrown | \n", "34.305557 | \n", "13.717514 | \n", "36.721283 | \n", "3.120179 | \n", "581.852344 | \n", "
4 | \n", "mstephens@davidson-herman.com | \n", "14023 Rodriguez Passage\\nPort Jacobville, PR 3... | \n", "MediumAquaMarine | \n", "33.330673 | \n", "12.795189 | \n", "37.536653 | \n", "4.446308 | \n", "599.406092 | \n", "