Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
2 views9 pages

Visualization

The lab report details the design and implementation of VLAN routing as part of a Computer Networks Lab course at Daffodil International University. It includes an exploration of the Heart Disease Classification Dataset using various data visualization techniques in Python, such as scatter plots, bar charts, pie charts, histograms, box plots, and heatmaps to analyze feature relationships and their impact on heart disease. Each visualization is accompanied by explanations of the insights derived from the data, highlighting trends and distributions relevant to heart disease classification.

Uploaded by

zoti15-6145
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Visualization

The lab report details the design and implementation of VLAN routing as part of a Computer Networks Lab course at Daffodil International University. It includes an exploration of the Heart Disease Classification Dataset using various data visualization techniques in Python, such as scatter plots, bar charts, pie charts, histograms, box plots, and heatmaps to analyze feature relationships and their impact on heart disease. Each visualization is accompanied by explanations of the insights derived from the data, highlighting trends and distributions relevant to heart disease classification.

Uploaded by

zoti15-6145
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

DAFFODIL INTERNATIONAL UNIVERSITY

LAB REPORT 05

Course Code: CSE314


Course Title: Computer Networks Lab
Experiment No: 05
Experiment Name: Design and Implementation of VLAN Routing.

Submitted To
Mr. Md. Alvee Ehsan
Lecturer
Department of Computer Science & Engineering
Daffodil International University

Submitted By
Most. Jannatul Firdousi Zoti
222-15-6145
62_A1
Department of Computer Science & Engineering
Daffodil International University

Date of Submission: 04-12-2024


Introduction
In this lab, we will explore the Heart Disease Classification Dataset using data visualization to
understand feature relationships and their impact on heart disease. The dataset includes attributes
like age, sex, cholesterol, and blood pressure.
Using Python libraries like Pandas, Matplotlib, and Seaborn, we will create scatter plots, pie charts,
bar charts, histograms, box plots, and heatmaps. These visualizations will help analyze
distributions, correlations, and key predictors of heart disease based on the target variable.

Import Libraries:

Read CSV file and Display Data:

Output:

Data Cleaning
Before visualization, we need to ensure that the data is clean and ready for analysis. We will check
for missing values and handle them appropriately.
Output:

Scatter Plot
Code:

This scatter plot is to visualize the relationships between two pairs of features in the Heart Disease
Classification Dataset. The first pair compares age (x-axis) with maximum heart rate
achieved (thalach, y-axis), represented by green points. The second pair compare cholesterol
levels (x-axis) with resting blood pressure (trestbps, y-axis), represented by red points. The plot is
customized with a title, axis labels, and a legend to differentiate between the two relationships.
The transparency (alpha=0.6) and edge color (edgecolor='black') of the points enhance readability.
Output:
The scatter plot displays two sets of points: Green points representing the relationship between age
and maximum heart rate, and Red points representing the relationship between cholesterol and
resting blood pressure. The plot helps identify trends, such as whether older patients tend to have
lower maximum heart rates or if higher cholesterol levels are associated with elevated resting blood
pressure. The legend distinguishes between the two relationships, and the plot is titled and labeled
for clarity, making it easy to interpret the relationships between these key features.

Bar Chart
Code:

This bar chart is to visualize the distribution of heart disease across genders in the Heart Disease
Classification Dataset. The countplot function from Seaborn is used to count the occurrences of
patients with and without heart disease (target) for each gender (sex). The bars are colored using a
custom palette, with dark blue representing patients without heart disease and coral representing
patients with heart disease. The plot is customized with a title, axis labels, and a legend to clearly
differentiate between the two categories.
Output:
The bar chart displays the count of patients with and without heart disease for each gender.
The dark blue bars represent patients without heart disease, while the coral bars represent patients
with heart disease. The plot helps identify whether one gender has a higher prevalence of heart
disease compared to the other. The legend, title, and axis labels provide clear context, making it
easy to interpret the distribution of heart disease across genders.

Pie Chart
Code:

This pie chart visualizes the distribution of different types of chest pain (cp) in the Heart Disease
Classification Dataset. The value_counts() function is used to count the occurrences of each chest
pain type. The pie chart uses a custom color palette with light blue, lavender shades, and coral to
represent the four categories: Typical Angina, Atypical Angina, Non-Anginal Pain,
and Asymptomatic. The explode parameter highlights the first slice (Typical Angina), and
the shadow parameter adds a 3D effect. The chart is customized with a title and percentage labels
for each slice.
Output:
The pie chart displays the proportion of patients experiencing each type of chest pain. The light
blue slice represents Typical Angina, the lavender shades represent Atypical Angina and Non-
Anginal Pain, and the coral slice represents Asymptomatic cases. The exploded slice (Typical
Angina) stands out, making it easy to identify the most or least common type of chest pain. The
percentage labels and title provide clear context, helping to interpret the distribution of chest pain
types in the dataset.

Histogram
Code

This histogram visualizes the distribution of cholesterol levels (chol) in the Heart Disease
Classification Dataset. The histplot function from Seaborn is used to plot the data, with a Kernel
Density Estimate (KDE) overlay for a smooth representation of the distribution. The bars are
colored light blue, and the plot is customized with a title, axis labels, and 20 bins to group the
cholesterol values. The tight_layout() function ensures proper spacing between subplots.
Output:

The histogram displays the frequency distribution of cholesterol levels among patients. The light
blue bars represent the count of patients within specific cholesterol ranges, while the KDE
curve provides a smooth estimate of the distribution. The plot helps identify patterns, such as
whether cholesterol levels are normally distributed or skewed, and highlights any outliers or
common ranges. The title and axis labels provide clear context, making it easy to interpret the
distribution of cholesterol levels in the dataset.

Boxplot
Code

This boxplot visualize the distribution of resting blood pressure (trestbps) in the Heart Disease
Classification Dataset. The boxplot function from Seaborn is used to plot the data, with the boxplot
colored coral. The plot is customized with a title and axis labels to provide context.
The tight_layout() function ensures proper spacing between subplots.
Output:
The boxplot displays the distribution of resting blood pressure values among patients. The coral
box represents the interquartile range (IQR), with the line inside the box indicating the median
value. The whiskers extend to show the range of the data, and any outliers are plotted as individual
points. The plot helps identify the central tendency, spread, and potential outliers in resting blood
pressure levels. The title and axis labels provide clear context, making it easy to interpret the
distribution of resting blood pressure in the dataset.

Correlation Heatmap
Code

This correlation heatmap is to visualize the relationships between selected numerical features in
the Heart Disease Classification Dataset. The corr() function calculates the correlation matrix for
the columns ['age', 'trestbps', 'chol', 'thalach', 'oldpeak', 'ca', 'target']. The heatmap function from
Seaborn is used to plot the matrix, with annotations displaying the correlation coefficients.
The coolwarm color map is used to represent the strength and direction of correlations, and the
plot is customized with a title and linewidths for better readability.
The heatmap displays the correlation coefficients between the selected features. The color intensity
indicates the strength and direction of the correlation: red for strong positive correlations, blue for
strong negative correlations, and white for no correlation. The annotations provide the exact
correlation values, making it easy to identify relationships such as whether older patients tend to
have lower maximum heart rates (thalach) or if higher cholesterol levels (chol) are associated with
other factors. The title and color map provide clear context, helping to interpret the relationships
between features in the dataset.

You might also like