The document outlines a process for predicting California housing prices using a linear regression model. It includes loading the dataset, selecting features, splitting the data into training and testing sets, training the model, and evaluating its performance using Mean Squared Error and R-squared metrics. Additionally, it visualizes the predicted versus actual housing prices with a scatter plot and a regression line.
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 ratings0% found this document useful (0 votes)
14 views2 pages
7 A
The document outlines a process for predicting California housing prices using a linear regression model. It includes loading the dataset, selecting features, splitting the data into training and testing sets, training the model, and evaluating its performance using Mean Squared Error and R-squared metrics. Additionally, it visualizes the predicted versus actual housing prices with a scatter plot and a regression line.
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/ 2
import pandas as pd
from sklearn.datasets import fetch_california_housing
from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, r2_score import matplotlib.pyplot as plt