Question: TensorFlow machine learning with Calilfornia housing data In [ ]: import numpy as np import pandas as pd from sklearn.datasets import fetch_california_housing from sklearn.model_selection import

"TensorFlow machine learning with Calilfornia housing data"

In [ ]:

 
import numpy as np
import pandas as pd
from sklearn.datasets import fetch_california_housing
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import scale
import matplotlib.pyplot as plt
import tensorflow as tf
import warnings
%matplotlib inline
warnings.filterwarnings('ignore') # Turn the warnings off.

Answer the following question by providing Python code:

In [ ]:

 
# Bring the data.
housing_data = fetch_california_housing()

In [ ]:

 
# Read the description.
print(housing_data['DESCR'])

1). Explore the data:

  • Display the dataset as a DataFrame with column labels.

In [ ]:

 
 

2). Build a machine learning model with TensorFlow.

  • Preprocess the data if necessary.
  • Build a linear regression model.
  • Train the model.
  • Calculate the error metrics such as MSE and RMSE (in-sample and out-of-sample). Target: RMSE < 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!