California Housing Data (CSV)
20,640 California census block groups with 8 features (median income, house age, rooms, etc.) and median house value target
A classic regression dataset published by Pace & Barry in 1997, based on the 1990 U.S. Census data. 20,640 neighborhoods, 8 features—covering geographic, economic, and demographic information, making it an ideal choice for learning regression models and housing price prediction.
The California housing price dataset is one of the most popular benchmark datasets in the field of regression analysis.
A standard housing price prediction regression task, suitable for benchmarking various regression algorithms such as linear regression, decision trees, and gradient boosting.
Includes latitude and longitude coordinates, supports spatial analysis and geographic visualization, exploring the relationship between housing prices and geographic locations.
Median income, housing age, and other socioeconomic indicators reflect the multidimensional influencing factors of the real world.
20,640 records, suitable for quick experiments and benchmarking, not too small to cause underfitting, and not too large to affect iteration speed.
The data is complete and clean, ready to use without complex data cleaning and missing value handling steps.
Public domain license, freely usable and redistributable, suitable for learning, teaching, research, and commercial projects.
From classroom exercises to production models—common uses of the California housing price dataset.
Build regression models to predict median housing prices, understanding the combined impact of multiple features on housing prices.
Utilize latitude and longitude coordinates for geographic visualization, discovering regional distribution patterns of housing prices.
Compare the MSE and R² performance of models such as linear regression, random forests, and XGBoost on standard data.
An ideal practice dataset for learning feature scaling, interaction features, polynomial features, and other feature engineering techniques.
Sample examples of the California housing price dataset (CSV format)
MedInc,HouseAge,AveRooms,AveBedrms,Population,AveOccup,Latitude,Longitude,MedHouseVal 8.3252,41.0,6.984,1.024,322.0,2.556,37.88,-122.23,4.526 8.3014,21.0,6.238,0.972,2401.0,2.110,37.86,-122.22,3.585 7.2574,52.0,8.288,1.073,496.0,2.802,37.85,-122.24,3.521 5.6431,52.0,5.817,1.073,558.0,2.547,37.85,-122.25,3.413 3.8462,52.0,6.282,1.081,565.0,2.181,37.85,-122.25,3.422
From browsing to using, it only takes a few minutes
View detailed descriptions, field definitions, and data previews of the California housing dataset on the Ace Data Cloud platform.
One-click download of a 1.8 MB CSV file to your local machine, no registration, no payment, get it instantly.
Load the data using Python, R, or any data analysis tool, and start training regression models or plotting spatial distribution maps.
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.metrics import mean_squared_error, r2_score
# Load data
df = pd.read_csv("california_housing.csv")
# Split features and target variable
X = df.drop("MedHouseVal", axis=1)
y = df["MedHouseVal"]
# Split training and testing sets
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42
)
# Train gradient boosting regression model
model = GradientBoostingRegressor(
n_estimators=200, max_depth=5, learning_rate=0.1, random_state=42
)
model.fit(X_train, y_train)
# Predict and evaluate
y_pred = model.predict(X_test)
mse = mean_squared_error(y_test, y_pred)
r2 = r2_score(y_test, y_pred)
print(f"Mean Squared Error (MSE): {mse:.4f}")
print(f"R² Score: {r2:.4f}")
The California housing dataset is one of the most commonly used regression benchmarks in the global data science community. Download for free and start exploring now.