Using a neural network in scikit-learn is straightforward and proceeds as follows:
- Load the data.
- Scale the data with a standard scaler.
- Do a hyperparameter search. Begin by varying the alpha parameter.
Using a neural network in scikit-learn is straightforward and proceeds as follows:
Load the medium-sized California housing dataset that we used in Chapter 9, Tree Algorithms and Ensembles:
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import fetch_california_housing
cali_housing = fetch_california_housing()
X = cali_housing.data
y = cali_housing.target
Bin the target variable so that the target train set and target test set are a bit more similar. Then use a stratified train/test split...