<jupyter_start><jupyter_text>California Housing datasetSource: https://www.kaggle.com/camnugent/california-housing-prices<jupyter_code>import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import os
csv_path = os.path.join('datasets','housing.csv')
housing_data = pd.read_csv(csv_path)
housing_data.sample(10)
housing_data.shape
housing_data.info()
housing_data.isnull().sum()
housing_data.dropna(inplace=True)
housing_data.isna().sum()
housing_data.shape
housing_data.describe().transpose()
housing_data['ocean_proximity'].shape
housing_data['ocean_proximity'].value_counts().sort_values()<jupyter_output><empty_output><jupyter_text>Visualizing Relationships<jupyter_code># total_rooms vs median_house_value

fig, ax = plt.subplots(figsize=(10,7))
plt.scatter(housing_data['total_rooms'], housing_data['median_house_value'])
plt.xlabel('total_rooms')
plt.ylabel('median_house_value')
plt.show()
# housing_median_age vs median_house_value
fig, ax = plt.subplots(figsize=(10,7))
plt.scatter(housing_data['housing_median_age'], housing_data['median_house_value'])
plt.xlabel('Housing Median Age')
plt.ylabel('Median House Value')
plt.show()
# median_income vs median_house_value
fig, ax = plt.subplots(figsize=(10,7))
plt.scatter(housing_data['median_income'], housing_data['median_house_value'])
plt.xlabel('Median Income')
plt.ylabel('Median House Value')
plt.show()
housing_data_corr = housing_data.corr()
housing_data_corr
fig, ax = plt.subplots(figsize=(10,7))
sns.heatmap(housing_data_corr, annot=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1346031746031746, 'fraction_numerical': 0.008888888888888889, 'mean_word_length': 10.338129496402878, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '240896', 'license': 'MIT', 'n_tokens_mistral': 618, 'n_tokens_neox': 578, 'n_words': 84, 'path': 'MachineLearningBasics/ExploringCaliforniaHousingDataset.ipynb', 'repo_name': 'arorapankaj/MachineLearningPractise', 'size': '1575'}