Loading, please wait...

VTU Circulars & Notifications

VTU Exam Circulars & Notifications

VTU Exam Time Table

VTU Academic Calendar

BCSL606 Program 2

PROGRAM:

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_california_housing

# Step 1: Load the California Housing Dataset
california_data = fetch_california_housing(as_frame=True)
data = california_data.frame

# Step 2: Compute the correlation matrix
correlation_matrix = data.corr()

# Step 3: Visualize the correlation matrix using a heatmap
plt.figure(figsize=(10, 8))
sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm', fmt='.2f', linewidths=0.5)
plt.title('Correlation Matrix of California Housing Features')
plt.show()

# Step 4: Create a pair plot to visualize pairwise relationships
sns.pairplot(data, diag_kind='kde', plot_kws={'alpha': 0.5})
plt.suptitle('Pair Plot of California Housing Features', y=1.02)
plt.show()

OUTPUT:

BCSL606-program-2-output-1
BCSL606-program-2-output-2
guest
7 Comments
sheeba
sheeba
25-01-2025 9:15 PM

can you send all programs in Machine learning to my mail id
couldnt able to download
thankyou

sheeba
sheeba
25-01-2025 9:16 PM

can you send all programs in Machine learning to my mail id
couldnt able to download
thankyou

ajay
ajay
13-02-2025 11:46 AM

while executing we are not getting the dataset from the table what you have shown
our table is empty

Dhanashree kulkarni
Dhanashree kulkarni
24-02-2025 12:56 PM

thanks for help

Abhishek DR
Abhishek DR
31-03-2026 9:45 AM

Good Work Sir..THANK YOU

Last edited 2 months ago by Abhishek DR
Venu
Venu
26-04-2026 9:24 AM

can u please send the datasets for all 10 programs to the email id i searched but cldnt find it anywhere

7
0
Would love your thoughts, please comment.x
()
x
Syllabus Papers
SGPA CGPA