Exploratory data analysis and descriptive statistics: Worked Example — Descriptive Analysis and Visualization (NVIDIA-Certified Associate: Accelerated Data Science)
Exploratory Data Analysis and Descriptive Statistics: Worked Example Exploratory Data Analysis (EDA) and descriptive statistics are foundational...
Exploratory Data Analysis and Descriptive Statistics: Worked Example
Exploratory Data Analysis (EDA) and descriptive statistics are foundational skills for any data scientist, especially when preparing data for GPU-accelerated modeling as covered in the NVIDIA-Certified Associate: Accelerated Data Science certification. This worked example demonstrates the step-by-step process of performing EDA and calculating descriptive statistics on a realistic dataset.
Scenario
Suppose you are given a dataset containing customer information for an e-commerce platform. The dataset includes variables such as Age, Annual Income (in thousands), and Spending Score (a score assigned by the platform based on customer behavior).
Step 1: Initial Data Inspection
Start by loading the dataset and inspecting the first few rows to understand its structure and identify any missing values or anomalies.
- Check data types for each variable.
- Look for null or missing values.
Reasoning: Understanding data types helps determine appropriate statistical methods and visualizations. Missing values need to be addressed before analysis.
Step 2: Summary Descriptive Statistics
Calculate key descriptive statistics for each numeric variable:
- Mean: Average value, indicating central tendency.
- Median: Middle value, robust to outliers.
- Standard Deviation (SD): Measures spread or variability.
- Minimum and Maximum: Range of data.
- Quartiles (Q1, Q3): Help understand distribution shape.
Example Calculation for Age:
- Mean Age = sum of all ages / number of customers.
- Median Age = middle value when ages are sorted.
- SD Age = square root of variance (average squared deviation from mean).
Step 3: Visualizing Distributions
Choose appropriate plots to visualize the distribution of each variable:
- Histograms: Show frequency distribution of continuous variables like Age and Annual Income.
- Boxplots: Highlight median, quartiles, and potential outliers.
Reasoning: Visualizations reveal patterns such as skewness, modality, and outliers that descriptive statistics alone may not fully capture.
Step 4: Identifying Relationships
Explore relationships between variables using scatter plots and correlation coefficients:
- Scatter Plot: Plot Annual Income vs. Spending Score to visually assess any trend.
- Pearson Correlation Coefficient: Quantify linear relationship strength and direction.
Interpretation: A positive correlation indicates that higher income customers tend to have higher spending scores.
Step 5: Interpretation and Next Steps
Summarize findings from descriptive statistics and visualizations:
- Age distribution may be approximately normal with some skewness.
- Annual Income shows wide variability with some high-income outliers.
- Spending Score distribution may be bimodal, suggesting distinct customer segments.
- Moderate positive correlation between Annual Income and Spending Score.
These insights guide feature engineering and model selection for accelerated data science workflows on GPUs.
Worked Example Summary
Dataset: Customer Age, Annual Income (k$), Spending Score
Step 1: Loaded data, confirmed no missing values.
Step 2: Calculated descriptive statistics:
- Age: Mean = 38.5, Median = 37, SD = 12.4
- Annual Income: Mean = 60.2k, Median = 58k, SD = 26.1k
- Spending Score: Mean = 50.3, Median = 49, SD = 25.7
Step 3: Histograms showed slight right skew for Age; boxplots identified a few income outliers.
Step 4: Scatter plot and Pearson correlation (r = 0.45) indicated a moderate positive relationship between income and spending score.
Step 5: Concluded data is suitable for further modeling after normalization and outlier treatment.
More in this topic
Ready to test your knowledge?
Put what you've learned into practice with a quick quiz and track your progress.
Test your knowledge →