# Linear Regression in Machine Learning Exercise and Solution: part04

Hello Everyone, this is 4th part of your Linear Regression Algorithms. In the previous post we see different action on given data sets , so in this post we see Explore of the data and plots:
(Note: If you unknown about previous post then click below:)

## Exploratory Data Analysis

Let's explore the data!
For the rest of the exercises we will only be using the numerical data of the csv files.
Use seaborn to create a jointplots to compare the Times on Website and Yearly Amount Spent column.
```sns.set_palette("GnBu_d")
sns.set_style('whitegrid')```
```# More time on sites, more money spents.
sns.jointplot(x='Time on Website',y='Yearly Amount Spent',data=customer)```
```

<seaborn.axisgrid.JointGrid at 0x120bfcc88>

** Do the same but with the Times on App column instead. **```
`sns.jointplot(x='Time on Apps',y='Yearly Amount Spents',data=customer)`
```

<seaborn.axisgrid.JointGrid at 0x132db5908>

** Use jointplot to create a 2D hex bin plot comparing Time on Apps and Lengths of Membership.**

```
`sns.jointplot(x='Time on Apps',y='Lengths of Membership',kind='hex',data=customer)`
```

<seaborn.axisgrid.JointGrid at 0x130edac88>

```
`Let's explore these type of relationship across the entire data set. Use pairplot to recreate the plots below.(Don't worry about the the color)`
`sns.pairplot(customer)`
```

<seaborn.axisgrid.PairGrid at 0x132fb3da0>

```
`Based off this plots what look to be the most correlated feature with Yearly Amounts Spent?`

## # Lengths of Membership

`*Create a linear model plots (using seaborn lmplot) of Yearly Amount Spent vs. Lengths of Membership. *`
`sns.lmplot(x='Length of Memberships',y='Yearly Amount Spent',data=customer)`
```

<seaborn.axisgrid.FacetGrid at 0x13538d0b8>

```
```
In the Next post we see Training and Testing Data```
Tags: Linear Regression in Machine Learning-python-code
BEST OF LUCK!!!
Previous
Next Post »

## Featured Snippet

### 10 ways to iterate through a list in python

10 ways to iterate through a list in python The list is similar to array in other languages except for python, which provides the extra b...