Machine Learning journey : Day 4 (Python | Descriptive Statistics | Case Study)
Tags: python, machinelearning, datascience, tutorial
Published: 2021-01-13 03:15:19

Subscribe to my [Youtube channel](https://tinyurl.com/y29gn693)

# Cardio Good Fitness Case Study

The market research team at AdRight is assigned the task to identify the profile of the typical customer for each treadmill product offered by CardioGood Fitness. The market research team decides to investigate whether there are differences across the product lines with respect to customer characteristics. The team decides to collect data on individuals who purchased a treadmill at a CardioGoodFitness retail store during the prior three months. The data are stored in the [CardioGoodFitness.csv](https://github.com/IamVigneshC/Machine-Learning-Data-Science/blob/master/Python/CardioGoodFitness-1.csv) file.

The team identifies the following customer variables to study:
- product purchased, TM195, TM498, or TM798;
- gender;
- age, in years;
- education, in years;
- relationship status, single or partnered;
- annual household income ;
- average number of times the customer plans to use the treadmill each week;
- average number of miles the customer expects to walk/run each week;
- self-rated fitness on an 1-to-5 scale, where 1 is poor shape and 5 is excellent shape.

## Perform descriptive analytics to create a customer profile for each CardioGood Fitness treadmill product line.

``` Python
# Load the necessary packages

import numpy as np
import pandas as pd

# Load the Cardio Dataset

mydata = pd.read_csv('CardioGoodFitness-1.csv')

mydata.head()
```

## Head:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/burjsqgs0fz7h1pzgcmb.png)

## Tail:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/09o7dk0apj2d6y65v076.png)


## Describe:

``` Python
mydata.describe(include="all")
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zgryc2a05kqndn5vdu1m.png)


## Info:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sna121haifeso60pddcd.png)


## Histogram:

``` Python
import matplotlib.pyplot as plt
%matplotlib inline

mydata.hist(figsize=(20,30))
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ysyfkigj7s44vwwerjka.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ypt3u3y2tpz0w4p13iny.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4y2xieosjss4p3ccx8h3.png)

## Boxplot:

``` Python
import seaborn as sns

sns.boxplot(x="Gender", y="Age", data=mydata)
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qgjcg49qlskqto38kvqo.png)


## Pair Plot

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lpjl1breld4jdrj6dlsc.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/peanu3vxyw7lzwwacykh.png)

## Crosstab:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/smxib8r6nmz3aohg76fa.png)


## Countplot:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/19gsli8lzzh1exa9c0n9.png)


## Pivot table:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rek6doqrnwoobj48yeij.png)


## Correlation with heat map:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/48gnutsrbz6zz4gzncax.png)



</BR>
Other useful links:

https://numpy.org/
https://pandas.pydata.org/
https://seaborn.pydata.org/
https://matplotlib.org/